Prompt method and electronic device for fitness training

ABSTRACT

This application provides a prompt method for fitness training and an electronic device, and relates to the field of artificial intelligence. The method includes: obtaining required training space, where the required training space is used to complete one or more training actions; determining, based on a training scenario in which a user is located and the required training space, a training location recommended to the user; and recording collecting a training action of the user based on the training location recommended to the user. A suitable training location is recommended to the user based on the training scenario in which the user is located and the required training space. Therefore, the user can also normally perform training in a scenario in which exercise space is limited, for example, when there is an obstruction or a site is insufficient.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority to Chinese Patent Application No.201910817621.1, filed with the China National Intellectual PropertyAdministration on Aug. 30, 2019, and entitled “PROMPT METHOD FOR FITNESSTRAINING AND ELECTRONIC DEVICE”, which is incorporated herein byreference in its entirety.

TECHNICAL FIELD

This application relates to the field of electronic technologies, and inparticular, to a prompt method and an electronic device for fitnesstraining.

BACKGROUND

In an intelligent fitness solution based on image processing, a trainingaction of a user can be evaluated in a training process, so that theuser can get professional guidance without leaving home. However, whentraining is performed in a scenario in which exercise space is limited,for example, a living room scenario or a dormitory scenario, thefollowing problems exist: an exercise space is insufficient, anobstruction affects action recognition accuracy, or an accident mayoccur in a training process. Consequently, the user cannot normallyperform training.

SUMMARY

This application provides a prompt method for fitness training and anelectronic device, so that a user can also normally perform training ina scenario in which exercise space is limited.

According to a first aspect, a prompt method for fitness training isprovided, applied to an electronic device, where the method includes:obtaining required training space, where the required training space isused to complete one or more training actions; determining, based on atraining scenario in which a user is located and the required trainingspace, a training location is recommended to the user; and recording atraining action of the user based on the training location recommendedto the user.

In this embodiment of this application, a suitable training location isrecommended to the user based on the training scenario in which the useris located and the required training space. Therefore, the user can alsonormally perform training in a scenario in which exercise space islimited, for example, when there is an obstruction or the site isinsufficient.

With reference to the first aspect, in a possible implementation, theobtaining required training space includes: determining the requiredtraining space based on an activity space of a coach in a target coursevideo; determining the required training space based on a body shapeparameter of the user; determining the required training space based onan activity space of a coach in a target course video and a body shapeparameter of the user; or determining the required training space basedon a training space parameter defined by the user.

Optionally, the determining the required training space based on theactivity space of a coach in a target course video includes: obtainingthe target course video; processing the target course video to obtain anactivity track of the coach; and determining the activity space of thecoach based on the activity track of the coach.

The required training space is determined based on the activity space ofthe coach in the target course video, and a suitable training locationis recommended to the user based on the training scenario and therequired training space. The user does not need to select, based onspace required by a course, a location for performing training, and thetraining location is recommended to the user based on the activity spaceof the coach. The recommended training location is more accurate, and ismore suitable for the user to perform training corresponding to thetarget course video.

Optionally, the body shape parameter of the user includes a height, aweight, a length of an upper arm, a length of a forearm, a length of athigh, a length of a crus, an eye height, a shoulder height, an elbowheight, a functional hand height, a sitting height, a body depth, aweight, a volume, a surface area, and the like.

When the required training space is determined based on the body shapeparameter of the user, a training location suitable for the user may berecommended to the user. The recommended training location is morepersonalized. This improves adaptation between the recommended traininglocation and the training action of the user.

When the required training space is determined based on the activityspace of the coach in the target course video and the body shapeparameter of the user, both a requirement of space required by thetraining action and a body shape of the user can be considered, so thata training location suitable for the user can be recommended to theuser.

With reference to the first aspect, in a possible implementation, thedetermining, based on a training scenario in which a user is located andthe required training space, a training location recommended to the userincludes: starting a camera of the electronic device, and scanning thetraining scenario; and in a scanning process, calculating a locationthat is in the training scenario and that meets the required trainingspace, and determining the location as the training location recommendedto the user.

With reference to the first aspect, in a possible implementation, thecamera is any one of an RGB camera, a depth camera, a wide-angle cameraor a camera mounted on a rotatable mechanical structure.

Depth information may be obtained by using the depth camera, so that thetraining location recommended to the user is more suitable for the userto perform training. A larger field of view can be obtained by using thewide-angle camera or the camera mounted on the rotatable mechanicalstructure, so that a selection range of the training locationrecommended to the user can be expanded, and a suitable traininglocation can be found more easily.

With reference to the first aspect, in a possible implementation, themethod further includes: determining a current location of the user inthe training scenario; and outputting prompt information based on thecurrent location of the user in the training scenario and the traininglocation recommended to the user, to prompt the user to move to thetraining location recommended to the user.

The user is guided by using the prompt information, so that the user canquickly reach the recommended training location, and the user does notneed to determine the location. This improves user experience, andensures that the user can also normally perform training in a scenarioin which exercise space is limited.

With reference to the first aspect, in a possible implementation, theprompt information includes at least one of a picture prompt, a voiceprompt, and a notification prompt.

With reference to the first aspect, in a possible implementation, beforethe recording a training action of the user based on the traininglocation recommended to the user, the method includes: determining thatthe user moves to the training location recommended to the user; andoutputting confirmation information, where the confirmation informationis used to prompt the user to start training.

Before the user starts training, the user is prompted to perform aconfirmation. This improves user experience.

With reference to the first aspect, in a possible implementation, themethod further includes: obtaining a plurality of frames of images ofthe user, where each frame of an image in the plurality of frames ofimages includes at least one recognized point; and performing an affinetransformation on any two frames of images in the plurality of frames ofimages based on the at least one recognized point.

The electronic device may obtain a plurality of frames of images of theuser, perform subject recognition on the user based on the plurality offrames of images, and perform an affine transformation on a recognizedpoint, to ensure that action matching is not affected by an angle, andensure that a change of the angle of the user relative to a picture doesnot affect accuracy of the training action evaluation.

According to a second aspect, an electronic device is provided,including one or more processors, one or more memories, a plurality ofapplication programs, and one or more programs, where the one or moreprograms are stored in the memory, and when the one or more programs areexecuted by the processor, the electronic device is enabled to performthe following steps: obtaining required training space, where therequired training space is used to complete one or more trainingactions; determining, based on a training scenario in which a user islocated and the required training space, a training location recommendedto the user; and recording a training action of the user based on thetraining location recommended to the user.

In this embodiment of this application, a suitable training location isrecommended to the user based on the training scenario in which the useris located and the required training space. Therefore, the user can alsonormally perform training in a scenario in which exercise space islimited, for example, when there is an obstruction or the site isinsufficient.

With reference to the second aspect, in a possible implementation, whenthe one or more programs are executed by the processor, the electronicdevice is enabled to perform the following steps: determining therequired training space based on an activity space of a coach in atarget course video; determining the required training space based on abody shape parameter of the user; determining the required trainingspace based on an activity space of a coach in a target course video anda body shape parameter of the user; or determining the required trainingspace based on a training space parameter defined by the user.

With reference to the second aspect, in a possible implementation, whenthe one or more programs are executed by the processor, the electronicdevice is enabled to perform the following steps: starting a camera ofthe electronic device, and scanning the training scenario; and in ascanning process, calculating a location that is in the trainingscenario and that meets the required training space, and determining thelocation as the training location recommended to the user.

With reference to the second aspect, in a possible implementation, thecamera is any one of an RGB camera, a depth camera, a wide-angle camera,or a camera mounted on a rotatable mechanical structure.

With reference to the second aspect, in a possible implementation, whenthe one or more programs are executed by the processor, the electronicdevice is enabled to perform the following steps: determining a currentlocation of the user in the training scenario; and outputting promptinformation based on the current location of the user in the trainingscenario and the training location recommended to the user, to promptthe user to move to the training location recommended to the user.

With reference to the second aspect, in a possible implementation, theprompt information includes at least one of a picture prompt, a voiceprompt, and a notification prompt.

With reference to the second aspect, in a possible implementation, whenthe one or more programs are executed by the processor, the electronicdevice is enabled to perform the following steps: determining that theuser moves to the training location recommended to the user; andoutputting confirmation information, where the confirmation informationis used to prompt the user to start training.

With reference to the second aspect, in a possible implementation, whenthe one or more programs are executed by the processor, the electronicdevice is enabled to perform the following steps: obtaining a pluralityof frames of images of the user, where each frame of an image in theplurality of frames of images includes at least one recognized point;and performing an affine transformation on any two frames of images inthe plurality of frames of images based on the at least one recognizedpoint.

According to a third aspect, a prompt method for fitness training isprovided, applied to an electronic device, where the method includes:obtaining required training space, where the required training space isused to complete one or more training actions; determining, based on atraining scenario in which a user is located and the required trainingspace, a training location recommended to the user; and displaying afirst interface, where the first interface includes a first window, thefirst window is used to display a framing interface of a camera of theelectronic device, the first window includes prompt information, and theprompt information is used to prompt the user to move to the traininglocation recommended to the user.

For example, the first interface may be a training interface 501 in FIG.5(a), FIG. 5(c), and FIG. 5(e), and the first window may be a viewfinderframe 503 in FIG. 5(a), FIG. 5(c), and FIG. 5(e).

With reference to the third aspect, in a possible implementation, thefirst interface further includes a second window, and the second windowis used to display a photography interface of the camera of theelectronic device.

For example, the second window may be a camera field of view 504 in FIG.5(a), FIG. 5(c), and FIG. 5(e).

With reference to the third aspect, in a possible implementation, theprompt information includes a recommended region that is displayed onthe ground and that corresponds to the training location recommended tothe user.

For example, the recommended region on the ground may be a recommendedregion 505 in FIG. 5(a), FIG. 5(c), and FIG. 5(e).

With reference to the third aspect, in a possible implementation, themethod further includes: obtaining a current location of the user in thetraining scenario; determining, based on the current location of theuser in the training scenario and the training location recommended tothe user, whether the user is at the training location recommended tothe user; and when the user is not at the training location recommendedto the user, displaying a first pop-up box, where the first pop-up boxis used to remind the user that the user has not reached the traininglocation recommended to the user, or prompt the user with a movementdirection and/or a movement distance; or when the user is, after apreset time expires, still not at the training location recommended tothe user, displaying a second pop-up box, where the second pop-up box isused to remind the user that the user has not reach, after the presettime expires, the training location recommended to the user, or promptthe user with a movement direction and/or a movement distance; or whenthe user is at the training location recommended to the user, displayinga third pop-up box, where the third pop-up box is used to remind theuser that the user has reached the training location recommended to theuser.

For example, the first pop-up box may be a prompt box 506 in FIG. 5(a)and FIG. 6(a), the second pop-up box may be a prompt box 506 in FIG.5(c) and FIG. 6(b), and the third pop-up box may be a prompt box 506 inFIG. 5(e) and FIG. 6(c).

With reference to the third aspect, in a possible implementation, whenthe user is at the training location recommended to the user, the methodfurther includes: displaying a second interface, where the secondinterface includes confirmation information, and the confirmationinformation is used to prompt the user to start training.

For example, the second interface may be a training interface 501 inFIG. 8(a) to FIG. 8(e), and the confirmation information is an actionrecognition icon 509, a gesture recognition icon 510, an instructionrecognition icon 511, a countdown timing icon 512, and a confirmationwindow 513 in FIG. 8(a) to FIG. 8(e).

According to a fourth aspect, an electronic device is provided,including one or more processors, one or more memories, a plurality ofapplication programs, and one or more programs, where the one or moreprograms are stored in the memory, and when the one or more programs areexecuted by the processor, the electronic device is enabled to performthe following steps: obtaining required training space, where therequired training space is used to complete one or more trainingactions; determining, based on a training scenario in which a user islocated and the required training space, a training location recommendedto the user; and displaying a first interface, where the first interfaceincludes a first window, the first window is used to display a framinginterface of a camera of the electronic device, the first windowincluding prompt information, and the prompt information is used toprompt the user to move to the training location recommended to theuser.

With reference to the fourth aspect, in a possible implementation, thefirst interface further includes a second window, and the second windowis used to display a photography interface of the camera of theelectronic device.

With reference to the fourth aspect, in a possible implementation, theprompt information includes a recommended region that is on the groundand that corresponds to the training location recommended to the user.

With reference to the fourth aspect, in a possible implementation, whenthe one or more programs are executed by the processor, the electronicdevice is enabled to perform the following steps: obtaining a currentlocation of the user in the training scenario; determining, based on thecurrent location of the user in the training scenario and the traininglocation recommended to the user, whether the user is at the traininglocation recommended to the user; and when the user is not at thetraining location recommended to the user, displaying a first pop-upbox, where the first pop-up box is used to remind the user that the userhas not reached the training location recommended to the user, or promptthe user with a movement direction and/or a movement distance; or whenthe user is, after a preset time expires, still not at the traininglocation recommended to the user, displaying a second pop-up box, wherethe second pop-up box is used to remind the user that the user has notreached, after the preset time expires, the training locationrecommended to the user, or prompt the user with a movement directionand/or a movement distance; or when the user is at the training locationrecommended to the user, displaying a third pop-up box, where the thirdpop-up box is used to remind the user that the user has reached thetraining location recommended to the user.

With reference to the fourth aspect, in a possible implementation, whenthe user is at the training location recommended to the user, and whenthe one or more programs are executed by the processor, the electronicdevice is enabled to perform the following step: displaying a secondinterface, where the second interface includes confirmation information,and the confirmation information is used to prompt the user to starttraining.

According to a fifth aspect, a prompt method for fitness training isprovided, applied to an electronic device, where the method includes:obtaining required training space, where the required training space isused to complete one or more training actions; determining, based on thetraining space, a training course and/or a training action that isrecommended to a user; and displaying a third interface, where the thirdinterface includes a third window, and the third window is used todisplay the training course and/or the training action that isrecommended to the user.

For example, the third interface may be a recommendation interface 311shown in FIG. 11(a), and the third window may be recommended content 313in FIG. 11(a).

With reference to the fifth aspect, in a possible implementation, themethod further includes: displaying a fourth interface before the thirdinterface is displayed, where the fourth interface includes a fourthwindow used to enter the third window; detecting a first operation ofthe user in the fourth window, where the first operation is used toselect a first option from a plurality of options; displaying a settingparameter of the first option in response to the first operation;detecting a second operation of the user in the fourth window, where thesecond operation is used to input the setting parameter of the firstoption; and displaying the third interface in response to the secondoperation.

For example, the fourth interface may be a recommendation interface 311shown in FIG. 11(b), and the fourth window may be a user-defined window314 in FIG. 11(b).

According to a sixth aspect, an electronic device is provided, includingone or more processors, one or more memories, a plurality of applicationprograms, and one or more programs, where the one or more programs arestored in the memory, and when the one or more programs are executed bythe processor, the electronic device is enabled to perform the followingsteps: obtaining required training space, where the required trainingspace is used to complete one or more training actions; determining,based on the training space, a training course and/or a training actionthat recommended to a user; and displaying a third interface, where thethird interface includes a third window, and the third window is used todisplay the training course and/or the training action that isrecommended to the user.

With reference to the sixth aspect, in a possible implementation, whenthe one or more programs are executed by the processor, the electronicdevice is enabled to perform the following steps: displaying a fourthinterface before the third interface is displayed, where the fourthinterface includes a fourth window used to enter the third window;detecting a first operation of the user in the fourth window, where thefirst operation is used to select a first option from a plurality ofoptions; displaying a setting parameter of the first option in responseto the first operation; detecting a second operation of the user in thefourth window, where the second operation is used to input the settingparameter of the first option; and displaying the third interface inresponse to the second operation.

According to a seventh aspect, this application provides an apparatus.The apparatus is included in an electronic device, and the apparatus hasa function of implementing behavior of the electronic device in theforegoing aspects and the possible implementations of the foregoingaspects. The function may be implemented by hardware, or may beimplemented by hardware executing corresponding software. The hardwareor the software includes one or more modules or units corresponding tothe foregoing function, for example, a display module or unit, adetection module or unit, or a processing module or unit.

According to an eighth aspect, this application provides an electronicdevice, including a touchscreen, where the touchscreen includes atouch-sensitive surface and a display; a camera; one or more processors;a memory; a plurality of applications; and one or more computerprograms. The one or more computer programs are stored in the memory.The one or more computer programs include instructions. When theinstructions are executed by the electronic device, the electronicdevice is enabled to perform the prompt method in any possibleimplementation of any one of the foregoing aspects.

According to a ninth aspect, this application provides an electronicdevice, including one or more processors and one or more memories. Theone or more memories are coupled to the one or more processors. The oneor more memories are configured to store computer program code, and thecomputer program code includes computer instructions. When the one ormore processors execute the computer instructions, the electronic deviceis enabled to perform the prompt method in any possible implementationof any one of the foregoing aspects.

According to a tenth aspect, this application provides a computerstorage medium, including computer instructions, where when the computerinstructions are run on an electronic device, the electronic device isenabled to perform the prompt method in any possible implementation ofany one of the foregoing aspects.

According to an eleventh aspect, this application provides a computerprogram product, where when the computer program product runs on anelectronic device, the electronic device is enabled to perform theprompt method in any possible implementation of any one of the foregoingaspects.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic diagram of a hardware structure of an electronicdevice according to an embodiment of this application;

FIG. 2 is a schematic diagram of a software structure of an electronicdevice according to an embodiment of this application;

FIG. 3(a) to FIG. 3(d) are schematic diagrams of entering a graphicaluser interface of an application program according to an embodiment ofthis application;

FIG. 4(a) and FIG. 4(b) are schematic diagrams of a graphical userinterface in an existing fitness solution based on image processing;

FIG. 5(a) to FIG. 5(f) are schematic diagrams of a graphical userinterface in a prompt method according to an embodiment of thisapplication;

FIG. 6(a) to FIG. 6(c) are schematic diagrams of a graphical userinterface in another prompt method according to an embodiment of thisapplication;

FIG. 7(a) and FIG. 7(b) are schematic diagrams of a graphical userinterface in still another prompt method according to an embodiment ofthis application;

FIG. 8(a) to FIG. 8(e) are schematic diagrams of a graphical userinterface in a prompt method according to an embodiment of thisapplication;

FIG. 9(a) to FIG. 9(c) are schematic diagrams of a graphical userinterface in a prompt method according to an embodiment of thisapplication;

FIG. 10(a) to FIG. 10(d) are schematic diagrams of entering a graphicaluser interface of an application program according to an embodiment ofthis application;

FIG. 11(a) and FIG. 11(b) are schematic diagrams of a graphical userinterface in a prompt method according to an embodiment of thisapplication;

FIG. 12 is a schematic diagram of a processing process of a promptmethod according to an embodiment of this application;

FIG. 13 is a schematic diagram of a processing process of a promptmethod according to an embodiment of this application;

FIG. 14 is a schematic flowchart of a prompt method according to anembodiment of this application; and

FIG. 15 is a schematic composition diagram of an electronic deviceaccording to an embodiment of this application.

DESCRIPTION OF EMBODIMENTS

The following describes the technical solutions in this application withreference to the accompanying drawings.

It should be noted that, in descriptions of the embodiments of thisapplication, “I” means “or” unless otherwise specified. For example, A/Bmay represent A or B. In this specification, “and/or” describes only anassociation relationship for describing associated objects andrepresents that three relationships may exist. For example, A and/or Bmay represent the following three cases: Only A exists, both A and Bexist, and only B exists. In addition, in the descriptions of theembodiments of this application, “a plurality of” means two or more.

The following terms “first” and “second” are merely intended for apurpose of description, and shall not be understood as an indication orimplication of relative importance or implicit indication of a quantityof indicated technical features. Therefore, a feature limited by “first”or “second” may explicitly or implicitly include one or more features.In the descriptions of the embodiments, unless otherwise specified, “aplurality of” means two or more.

As described in the background, in an intelligent fitness solution basedon image processing, a training action of a user can be evaluated in atraining process, so that the user can get professional guidance withoutleaving home. However, in the current intelligent fitness solution basedon image processing, a location of the user in a training scenariocannot be provided for the user, or a location recommended to the userto stand conflicts with an object in a training scenario. In particular,in a scenario in which exercise space is limited, for example, a livingroom scenario or a dormitory scenario, the following problems exist:exercise space is insufficient, an obstruction affects actionrecognition accuracy, or an accident may occur in a training process.Consequently, the user possibly cannot normally perform training.Therefore, a prompt method for fitness training is required. In thisway, a suitable training location may be provided for the user in thetraining scenario, so that the user can also normally perform trainingin a scenario in which exercise space is limited, and in particular, theuser can normally take fitness exercise based on image processing.

The embodiments of this application provide a prompt method for fitnesstraining, and the method may be applied to an electronic device. When auser expects to perform training in a scenario in which exercise spaceis limited, a suitable training location can be intelligentlyrecommended to the user based on a training scenario in which the useris located and required training space, and the user does not need toselect the training location, to ensure that training is normallyperformed.

The prompt method for fitness training provided in the embodiments ofthis application may be applied to an electronic device such as a mobilephone, a tablet computer, a wearable device, a vehicle-mounted device,an augmented reality (AR)/virtual reality (VR) device, a notebookcomputer, an ultra-mobile personal computer (UMPC), a netbook, or apersonal digital assistant (PDA). A specific type of the electronicdevice is not limited in the embodiments of this application.

For example, FIG. 1 is a schematic diagram of a structure of anelectronic device 100. The electronic device 100 may include a processor110, an external memory interface 120, an internal memory 121, auniversal serial bus (USB) port 130, a charging management module 140, apower management module 141, a battery 142, an antenna 1, an antenna 2,a mobile communications module 150, a wireless communications module160, an audio module 170, a speaker 170A, a receiver 170B, a microphone170C, a headset jack 170D, a sensor module 180, a button 190, a motor191, an indicator 192, a camera 193, a display 194, a subscriberidentification module (SIM) card interface 195, and the like. The sensormodule 180 may include a pressure sensor 180A, a gyroscope sensor 180B,a barometric pressure sensor 180C, a magnetic sensor 180D, anacceleration sensor 180E, a range sensor 180F, an optical proximitysensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, atouch sensor 180K, an ambient light sensor 180L, a bone conductionsensor 180M, and the like.

It may be understood that the structure shown in the embodiments of thisapplication does not constitute a specific limitation on the electronicdevice 100. In some other embodiments of this application, theelectronic device 100 may include more or fewer components than thoseshown in the figure, or some components may be combined, or somecomponents may be split, or there may be a different componentarrangement. The components shown in the figure may be implemented byhardware, software, or a combination of software and hardware.

The processor 110 may include one or more processing units. For example,the processor 110 may include an application processor (AP), a modemprocessor, a graphics processing unit (GPU), an image signal processor(ISP), a controller, a memory, a video codec, a digital signal processor(DSP), a baseband processor, and/or a neural-network processing unit(NPU). Different processing units may be independent components, or maybe integrated into one or more processors.

The controller may be a nerve center and a command center of theelectronic device 100. The controller may generate an operation controlsignal based on an instruction operation code and a time sequencesignal, to control instruction reading and instruction execution.

A memory may be further disposed in the processor 110, and is configuredto store instructions and data. In some embodiments, the memory in theprocessor 110 is a cache. The memory may store instructions or data justused or cyclically used by the processor 110. If the processor 110 needsto use the instructions or the data again, the processor 110 maydirectly invoke the instructions or the data from the memory. Thisavoids repeated access, reduces waiting time of the processor 110, andimproves system efficiency.

In some embodiments, the processor 110 may include one or moreinterfaces. The interface may include an inter-integrated circuit (I2C)interface, an inter-integrated circuit sound (I2S) interface, a pulsecode modulation (PCM) interface, a universal asynchronousreceiver/transmitter (UART) interface, a mobile industry processorinterface (MIPI), a general-purpose input/output (GPIO) interface, asubscriber identification module (SIM) interface, a universal serial bus(USB) port.

The I2C interface is a two-way synchronization serial bus, and includesa serial data line (SDA) and a serial clock line (SCL). In someembodiments, the processor 110 may include a plurality of groups of I2Cbuses. The processor 110 may be coupled to the touch sensor 180K, acharger, a flash, the camera 193, and the like through different I2C businterfaces. For example, the processor 110 may be coupled to the touchsensor 180K through the I2C interface, so that the processor 110communicates with the touch sensor 180K through the I2C bus interface,to implement a touch function of the electronic device 100.

The I2S interface may be configured to perform audio communication. Insome embodiments, the processor 110 may include a plurality of groups ofI2S buses. The processor 110 may be coupled to the audio module 170through the I2S bus, to implement communication between the processor110 and the audio module 170. In some embodiments, the audio module 170may transmit an audio signal to the wireless communications module 160through the I2S interface, to implement a function of answering a callthrough a Bluetooth headset.

The PCM interface may also be configured to perform audio communication,and sample, quantize, and code an analog signal. In some embodiments,the audio module 170 may be coupled to the wireless communicationsmodule 160 through a PCM bus interface. In some embodiments, the audiomodule 170 may also transmit an audio signal to the wirelesscommunications module 160 through the PCM interface, to implement afunction of answering a call through a Bluetooth headset. Both the I2Sinterface and the PCM interface may be configured to perform audiocommunication.

The UART interface is a universal serial data bus, and is configured toperform asynchronous communication. The bus may be a two-waycommunications bus. The bus converts to-be-transmitted data betweenserial communication and parallel communication. In some embodiments,the UART interface is usually configured to connect the processor 110and the wireless communications module 160. For example, the processor110 communicates with a Bluetooth module in the wireless communicationsmodule 160 through the UART interface, to implement a Bluetoothfunction. In some embodiments, the audio module 170 may transmit anaudio signal to the wireless communications module 160 through the UARTinterface, to implement a function of playing music through a Bluetoothheadset.

The MIPI interface may be configured to connect the processor 110 and aperipheral component such as the display 194 or the camera 193. The MIPIinterface includes a camera serial interface (CSI), a display serialinterface (DSI), or the like. In some embodiments, the processor 110communicates with the camera 193 via the CSI interface, to implement aphotography function of the electronic device 100. The processor 110communicates with the display 194 through the DSI interface, toimplement a display function of the electronic device 100.

The GPIO interface may be configured by software. The GPIO interface maybe configured as a control signal or a data signal. In some embodiments,the GPIO interface may be configured to connect the processor 110 to thecamera 193, the display 194, the wireless communications module 160, theaudio module 170, the sensor module 180, or the like. The GPIO interfacemay alternatively be configured as the I2C interface, the I2S interface,the UART interface, the MIPI interface, or the like.

The USB port 130 is a port that conforms to a USB standardspecification, and may be specifically a mini USB port, a micro USBport, a USB Type-C port, or the like. The USB port 130 may be configuredto connect to a charger to charge the electronic device 100, or may beconfigured to transmit data between the electronic device 100 and aperipheral device, or may be configured to connect to a headset to playaudio through the headset. Alternatively, the port may be configured toconnect to another electronic device, for example, an AR device.

It may be understood that an interface connection relationship betweenthe modules illustrated in this embodiment of this application is merelyan example for description, and does not constitute a limitation on thestructure of the electronic device 100. In some other embodiments ofthis application, the electronic device 100 may alternatively use aninterface connection manner different from that in the foregoingembodiment, or a combination of a plurality of interface connectionmanners.

The charging management module 140 is configured to receive a charginginput from the charger. The charger may be a wireless charger or a wiredcharger. In some embodiments of wired charging, the charging managementmodule 140 may receive a charging input from a wired charger through theUSB port 130. In some embodiments of wireless charging, the chargingmanagement module 140 may receive a wireless charging input by using awireless charging coil of the electronic device 100. The chargingmanagement module 140 may further supply power to the electronic deviceby using the power management module 141 while charging the battery 142.

The power management module 141 is configured to connect to the battery142, the charging management module 140, and the processor 110. Thepower management module 141 receives an input from the battery 142and/or the charging management module 140, and supplies power to theprocessor 110, the internal memory 121, an external memory, the display194, the camera 193, the wireless communications module 160, and thelike. The power management module 141 may be further configured tomonitor parameters such as a battery capacity, a battery cycle count,and a battery status of health (electric leakage and impedance). In someother embodiments, the power management module 141 may alternatively bedisposed in the processor 110. In some other embodiments, the powermanagement module 141 and the charging management module 140 mayalternatively be disposed in a same device.

A wireless communication function of the electronic device 100 may beimplemented by using the antenna 1, the antenna 2, the mobilecommunications module 150, the wireless communications module 160, themodem processor, the baseband processor, and the like.

The antenna 1 and the antenna 2 are configured to transmit and receiveelectromagnetic wave signals. Each antenna in the electronic device 100may be configured to cover one or more communication frequency bands.Different antennas may further be multiplexed, to improve antennautilization. For example, the antenna 1 may be multiplexed as adiversity antenna in a wireless local area network. In some otherembodiments, the antenna may be used in combination with a tuningswitch.

The mobile communications module 150 may provide a wirelesscommunication solution applied to the electronic device 100 andincluding 2G, 3G, 4G, 5G, or the like. The mobile communications module150 may include at least one filter, a switch, a power amplifier, a lownoise amplifier (LNA), and the like. The mobile communications module150 may receive an electromagnetic wave through the antenna 1, performprocessing such as filtering and amplification on the receivedelectromagnetic wave, and transmit a processed electromagnetic wave tothe modem processor for demodulation. The mobile communications module150 may further amplify a signal modulated by the modem processor, andconvert the signal into an electromagnetic wave through the antenna 1for transmission. In some embodiments, at least some function modules inthe mobile communications module 150 may be disposed in the processor110. In some embodiments, at least some function modules of the mobilecommunications module 150 and at least some modules of the processor 110may be disposed in a same device.

The modem processor may include a modulator and a demodulator. Themodulator is configured to modulate a to-be-sent low-frequency basebandsignal into a medium/high-frequency signal. The demodulator isconfigured to demodulate a received electromagnetic wave signal into alow-frequency baseband signal. Then, the demodulator transmits thelow-frequency baseband signal obtained through demodulation to thebaseband processor for processing. After being processed by the basebandprocessor, the low-frequency baseband signal is transmitted to theapplication processor. The application processor outputs a sound signalby using an audio device (which is not limited to the speaker 170A, thereceiver 170B, or the like), or displays an image or a video on thedisplay 194. In some embodiments, the modem processor may be anindependent component. In some other embodiments, the modem processormay be independent of the processor 110, and is disposed in a samedevice as the mobile communications module 150 or another functionmodule.

The wireless communications module 160 may provide a wirelesscommunication solution that is applied to the electronic device 100 andthat includes a wireless local area network (WLAN) (for example, awireless fidelity (Wi-Fi) network), Bluetooth (BT), a global navigationsatellite system (GNSS), frequency modulation (FM), a near fieldcommunication (NFC) technology, an infrared (IR) technology, or thelike. The wireless communications module 160 may be one or morecomponents integrating at least one communications processing module.The wireless communications module 160 receives an electromagnetic wavethrough the antenna 2, performs frequency modulation and filteringprocessing on an electromagnetic wave signal, and sends a processedsignal to the processor 110. The wireless communications module 160 mayfurther receive a to-be-sent signal from the processor 110, performfrequency modulation and amplification on the signal, and convert aprocessed signal into an electromagnetic wave through the antenna 2 fortransmission.

In some embodiments, the antenna 1 and the mobile communications module150 in the electronic device 100 are coupled, and the antenna 2 and thewireless communications module 160 in the electronic device 100 arecoupled, so that the electronic device 100 can communicate with anetwork and another device by using a wireless communicationstechnology. The wireless communications technology may include a globalsystem for mobile communications (GSM), general packet radio service(GPRS), code division multiple access (CDMA), wideband code divisionmultiple access (WCDMA), time-division code division multiple access(TD-CDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and/or IRtechnology. The GNSS may include a global positioning system (GPS), aglobal navigation satellite system (GLONASS), a BeiDou navigationsatellite system (BDS), a quasi-zenith satellite system (QZSS), and/or asatellite based augmentation system (SBAS).

The electronic device 100 implements a display function through the GPU,the display 194, the application processor, and the like. The GPU is amicroprocessor for image processing, and is connected to the display 194and the application processor. The GPU is configured to: performmathematical and geometric calculation, and render an image. Theprocessor 110 may include one or more GPUs that execute programinstructions to generate or change display information.

For example, in the prompt method provided in the embodiments of thisapplication, the GPU/NPU/CPU may run a user recognition algorithm suchas a skeleton point recognition algorithm, to process an obtained imageof a user and extract information about the user.

The display 194 is configured to display an image, a video, and thelike. The display 194 includes a display panel. The display panel may bea liquid crystal display (LCD), an organic light-emitting diode (OLED),an active-matrix organic light-emitting diode (AMOLED), a flexiblelight-emitting diode (FLED), a mini-LED, a micro-LED, a micro-OLED, aquantum dot light-emitting diode (QLED), or the like. In someembodiments, the electronic device 100 may include one or N displays194, where N is a positive integer greater than 1.

The electronic device 100 may implement a photography function throughthe ISP, the camera 193, the video codec, the GPU, the display 194, theapplication processor, and the like.

The ISP is configured to process data fed back by the camera 193. Forexample, during photography, a shutter is pressed, and light istransmitted to a photosensitive element of the camera through a lens.The photosensitive element of the camera converts an optical signal intoan electrical signal, and transmits the electrical signal to the ISP forprocessing, to convert the electrical signal into a visible image. TheISP may further perform algorithm optimization on noise, brightness, andcomplexion of the image. The ISP may further optimize parameters such asexposure and a color temperature of a photographing scenario. In someembodiments, the ISP may be disposed in the camera 193.

The camera 193 is configured to capture a static image or a video. Anoptical image of an object is generated through the lens, and isprojected onto a photosensitive element. The photosensitive element maybe a charge-coupled device (CCD) or a complementarymetal-oxide-semiconductor (CMOS) phototransistor. The photosensitiveelement converts an optical signal into an electrical signal, and thentransmits the electrical signal to the ISP to convert the electricalsignal into a digital image signal. The ISP outputs the digital imagesignal to the DSP for processing. The DSP converts the digital imagesignal into a standard image signal in an RGB format, a YUV format, orthe like. In some embodiments, the electronic device 100 may include oneor N cameras 193, where N is a positive integer greater than 1.

For example, in the prompt method provided in the embodiments of thisapplication, the camera may collect images of the user and a trainingscenario, and display the collected images in a viewfinder frame or apreview interface. The photosensitive element converts a collectedoptical signal into an electrical signal, and then transmits theelectrical signal to the ISP to convert the electrical signal into adigital image signal. The ISP outputs the digital image signal to theDSP for related image processing.

The digital signal processor is configured to process a digital signal,and may further process another digital signal in addition to thedigital image signal. For example, when the electronic device 100selects a frequency, the digital signal processor is configured toperform Fourier transform and the like on frequency energy.

The video codec is configured to compress or decompress a digital video.The electronic device 100 may support one or more video codecs. In thisway, the electronic device 100 can play or record videos in a pluralityof coding formats, for example, moving picture experts group (MPEG)-1,MPEG-2, MPEG-3, and MPEG-4.

The NPU is a neural-network (NN) computing processor. With reference toa structure of a biological neural network, for example, with referenceto a transfer mode between neurons of a human brain, the NPU quicklyprocesses input information, and can further continuously performself-learning. Applications such as intelligent cognition of theelectronic device 100 may be implemented through the NPU, for example,image recognition, facial recognition, speech recognition, and textunderstanding.

For example, in the prompt method provided in the embodiments of thisapplication, the NPU may perform action matching, gesture recognition,voice recognition, and the like in a training start confirmation processafter the user moves to a recommended training location.

The external memory interface 120 may be configured to connect to anexternal memory card such as a micro SD card, to extend a storagecapability of the electronic device 100. The external memory cardcommunicates with the processor 110 through the external memoryinterface 120, to implement a data storage function. For example, filessuch as music and a video are stored in the external memory card.

The internal memory 121 may be configured to store computer-executableprogram code. The executable program code includes instructions. Theprocessor 110 runs the instructions stored in the internal memory 121,to perform various function applications of the electronic device 100and data processing. The internal memory 121 may include a programstorage area and a data storage area. The program storage area may storean operating system, an application required by at least one function(for example, a sound playing function and an image playing function),and the like. The data storage area may store data (for example, audiodata and an address book) and the like created when the electronicdevice 100 is used. In addition, the internal memory 121 may include ahigh-speed random access memory, and may further include a nonvolatilememory such as at least one magnetic disk storage device, a flash memorydevice, or a universal flash storage (UFS).

The electronic device 100 may implement audio functions such as musicplaying and recording by using the audio module 170, the speaker 170A,the receiver 170B, the microphone 170C, the headset jack 170D, theapplication processor, and the like.

The audio module 170 is configured to convert digital audio informationinto an analog audio signal for output, and is also configured toconvert an analog audio input into a digital audio signal. The audiomodule 170 may be further configured to encode and decode audio signals.In some embodiments, the audio module 170 may be disposed in theprocessor 110, or some function modules of the audio module 170 aredisposed in the processor 110.

The speaker 170A, also referred to as a “horn”, is configured to convertan audio electrical signal into a sound signal. The user of theelectronic device 100 may be used to listen to music, play voice oranswer a call in a hands-free mode by using the speaker 170A.

For example, in the prompt method provided in the embodiments of thisapplication, the speaker may play voice used to prompt the user to moveto the recommended training location.

The receiver 170B, also referred to as an “earpiece”, is configured toconvert an audio electrical signal into a sound signal. When the user ofthe electronic device 100 is used to answer a call or listen to a voicemessage, the receiver 170B may be placed near a human ear to listen to avoice.

The microphone 170C, also referred to as a “mike” or “mic”, isconfigured to convert a sound signal into an electrical signal. Whenmaking a call or sending a voice message, the user may make a sound nearthe microphone 170C through the mouth, to enter a sound signal to themicrophone 170C. At least one microphone 170C may be disposed in theelectronic device 100. In some other embodiments, two microphones 170Cmay be disposed in the electronic device 100, to implement a noisereduction function in addition to a function of recording a soundsignal. In some other embodiments, three, four, or more microphones 170Cmay be alternatively disposed in the electronic device 100, to collect asound signal, implement noise reduction, and identify a sound source, soas to implement a directional recording function and the like.

The headset jack 170D is configured to connect to a wired headset. Theheadset jack 170D may be the USB port 130, or may be a 3.5 mm openmobile terminal platform (OMTP) standard interface or a cellulartelecommunications industry association of the USA (CTIA) standardinterface.

The pressure sensor 180A is configured to sense a pressure signal, andcan convert the pressure signal into an electrical signal. In someembodiments, the pressure sensor 180A may be disposed on the display194. There are many types of pressure sensors 180A, such as a resistivepressure sensor, an inductive pressure sensor, and a capacitive pressuresensor. The capacitive pressure sensor may include at least two parallelplates made of conductive materials. When force is applied to thepressure sensor 180A, a capacitance between electrodes changes. Theelectronic device 100 determines pressure strength based on a change ofthe capacitance. When a touch operation is performed on the display 194,the electronic device 100 detects intensity of the touch operation byusing the pressure sensor 180A. The electronic device 100 may calculatea touch location based on a detection signal of the pressure sensor180A. In some embodiments, touch operations that are performed at a sametouch location but have different touch operation intensity maycorrespond to different operation instructions. For example, when atouch operation whose touch operation intensity is less than a firstpressure threshold is performed on an icon of Messages, an instructionfor viewing an SMS message is executed. When a touch operation whosetouch operation intensity is greater than or equal to the first pressurethreshold is performed on the icon of Messages, an instruction forcreating a new SMS message is executed.

The gyroscope sensor 180B may be configured to determine a movingposture of the electronic device 100. In some embodiments, angularvelocities of the electronic device 100 around three axes (namely, axesx, y, and z) may be determined by using the gyroscope sensor 180B. Thegyroscope sensor 180B may be configured to implement image stabilizationduring photography. For example, when the shutter is pressed, thegyroscope sensor 180B detects an angle through which the electronicdevice 100 moves, and calculates, based on the angle, a distance forwhich a lens module needs to compensate, so that the lens cancels theshake of the electronic device 100 through reverse motion, therebyimplementing the image stabilization. The gyroscope sensor 180B may befurther used in a navigation scenario and a motion-sensing gamescenario.

The barometric pressure sensor 180C is configured to measure barometricpressure. In some embodiments, the electronic device 100 calculates analtitude by using a barometric pressure value measured by the barometricpressure sensor 180C, to assist in positioning and navigation.

The magnetic sensor 180D includes a Hall effect sensor. The electronicdevice 100 may detect opening and closing of a flip cover by using themagnetic sensor 180D. In some embodiments, when the electronic device100 is a clamshell phone, the electronic device 100 may detect openingand closing of a clamshell by using the magnetic sensor 180D. Further, afeature such as automatic unlocking upon opening of the flip cover isset based on a detected opening or closing state of the leather case ora detected opening or closing state of the flip cover.

The acceleration sensor 180E may detect magnitude of acceleration of theelectronic device 100 in various directions (usually on three axes).When the electronic device 100 is still, magnitude and a direction ofgravity may be detected. The acceleration sensor may be furtherconfigured to recognize a posture of the electronic device, and is usedin an application such as switching between a landscape mode and aportrait mode or a pedometer.

The range sensor 180F is configured to measure a distance. Theelectronic device 100 may measure a distance in an infrared or a lasermanner. In some embodiments, in a photography scenario, the electronicdevice 100 may measure a distance by using the range sensor 180F, toimplement quick focusing.

The optical proximity sensor 180G may include, for example, alight-emitting diode (LED) and an optical detector such as a photodiode.The light-emitting diode may be an infrared light-emitting diode. Theelectronic device 100 emits infrared light by using the light-emittingdiode. The electronic device 100 detects, by using the photodiode,infrared reflected light from a nearby object. When sufficient reflectedlight is detected, it may be determined that there is an object near theelectronic device 100. When detecting insufficient reflected light, theelectronic device 100 may determine that there is no object near theelectronic device 100. The electronic device 100 may detect, by usingthe optical proximity sensor 180G, that the user holds the electronicdevice 100 close to an ear for a call, to automatically performscreen-off to save power. The optical proximity sensor 180G may also beused in a smart cover mode or a pocket mode to automatically performscreen unlocking or locking.

The ambient light sensor 180L is configured to sense ambient lightbrightness. The electronic device 100 may adaptively adjust brightnessof the display 194 based on the sensed ambient light brightness. Theambient light sensor 180L may also be configured to automatically adjustwhite balance during photography. The ambient light sensor 180L mayfurther cooperate with the optical proximity sensor 180G to detectwhether the electronic device 100 is in a pocket, to prevent anaccidental touch.

The fingerprint sensor 180H is configured to collect a fingerprint. Theelectronic device 100 may use a feature of the collected fingerprint toimplement fingerprint-based unlocking, application lock access,fingerprint-based photography, fingerprint-based call answering, and thelike.

The temperature sensor 180J is configured to detect a temperature. Insome embodiments, the electronic device 100 executes a temperatureprocessing policy based on the temperature detected by the temperaturesensor 180J. For example, when the temperature reported by thetemperature sensor 180J exceeds a threshold, the electronic device 100degrades performance of a processor near the temperature sensor 180J, toreduce power consumption and implement thermal protection. In some otherembodiments, when the temperature is less than another threshold, theelectronic device 100 heats up the battery 142, to avoid abnormalshutdown of the electronic device 100 due to a low temperature. In someother embodiments, when the temperature is lower than still anotherthreshold, the electronic device 100 boosts an output voltage of thebattery 142 to avoid abnormal shutdown caused by a low temperature.

The touch sensor 180K is also referred to as a “touch panel”. The touchsensor 180K may be disposed on the display 194, and the touch sensor180K and the display 194 form a touchscreen, which is also referred toas a “touch screen”. The touch sensor 180K is configured to detect atouch operation performed on or near the touch sensor 180K. The touchsensor may transfer the detected touch operation to the applicationprocessor, to determine a type of a touch event. A visual output relatedto the touch operation may be provided on the display 194. In some otherembodiments, the touch sensor 180K may alternatively be disposed on asurface of the electronic device 100 at a position different from thatof the display 194.

The bone conduction sensor 180M may obtain a vibration signal. In someembodiments, the bone conduction sensor 180M may obtain a vibrationsignal of a vibration bone of a human vocal-cord. The bone conductionsensor 180M may also be able to detect a human pulse, and receive ablood pressure signal. In some embodiments, the bone conduction sensor180M may also be disposed in the headset, to form a bone conductionheadset. The audio module 170 may obtain a speech signal through parsingbased on the vibration signal that is of the vibration bone of thevocal-cord and that is obtained by the bone conduction sensor 180M, toimplement a speech function. The application processor may parse heartrate information based on the blood pressure signal obtained by the boneconduction sensor 180M, to implement a heart rate detection function.

The button 190 includes a power button, a volume button, and the like.The button 190 may be a mechanical button, or may be a touch button. Theelectronic device 100 may receive a button input, and generate a buttonsignal input related to user settings and function control of theelectronic device 100.

The motor 191 may generate a vibration prompt. The motor 191 may beconfigured to produce an incoming call vibration prompt and a touchvibration feedback. For example, touch operations performed on differentapplications (for example, photography and audio playing) may correspondto different vibration feedback effects. For touch operations performedin different areas of the display 194, the motor 191 may also correspondto different vibration feedback effects. Different application scenarios(for example, a time reminder, information receiving, an alarm clock,and a game) may also correspond to different vibration feedback effects.A touch vibration feedback effect may be further customized

The indicator 192 may be an indicator light, and may be configured toindicate a charging status and a power change, or may be configured toindicate a message, a missed call, a notification, and the like.

The SIM card interface 195 is configured to connect to a SIM card. TheSIM card may be inserted into the SIM card interface 195 or removed fromthe SIM card interface 195, to implement contact with or separation fromthe electronic device 100. The electronic device 100 may support one orN SIM card interfaces, where N is a positive integer greater than 1. TheSIM card interface 195 may support a nano SIM card, a micro SIM card, aSIM card, and the like. A plurality of cards may be simultaneouslyinserted into a same SIM card interface 195. The plurality of cards maybe of a same type or of different types. The SIM card interface 195 isalso compatible with different types of SIM cards. The SIM cardinterface 195 is also compatible with an external memory card. Theelectronic device 100 interacts with a network by using the SIM card, toimplement functions such as calling and data communication. In someembodiments, the electronic device 100 uses an eSIM, namely, an embeddedSIM card. The eSIM card may be embedded in the electronic device 100,and cannot be separated from the electronic device 100.

A software system of the electronic device 100 may use a layeredarchitecture, an event-driven architecture, a microkernel architecture,a micro service architecture, or a cloud architecture. In an embodimentof this application, an Android system with a layered architecture isused as an example to describe a software structure of the electronicdevice 100.

FIG. 2 is a block diagram of the software structure of the electronicdevice 100 according to an embodiment of this application. In a layeredarchitecture, software is divided into several layers, and each layerhas a clear role and task. The layers communicate with each otherthrough a software interface. In some embodiments, the Android system isdivided into four layers: an application layer, an application frameworklayer, an Android runtime and system library, and a kernel layer fromtop to bottom. The application layer may include a series of applicationpackages.

As shown in FIG. 2, the application packages may include applicationssuch as “camera”, “gallery”, “calendar”, “phone”, “map”, “navigation”,“WLAN”, “Bluetooth”, “music”, “videos”, and “messages”.

The application framework layer provides an application programminginterface (API) and a programming framework for an application at theapplication layer. The application framework layer includes somepredefined functions.

For example, in this application, a user identification function oralgorithm, an image processing algorithm, and the like may all beincluded in the application framework layer.

As shown in FIG. 2, the application framework layer may include a windowmanager, a content provider, a view system, a phone manager, a resourcemanager, a notification manager, and the like.

The window manager is configured to manage a window program. The windowmanager may obtain a size of a display, determine whether there is astatus bar, perform screen locking, take a screenshot, and the like.

The content provider is configured to store and obtain data, and enablethe data to be accessible by an application. The data may include avideo, an image, audio, calls that are made and received, a browsinghistory and a bookmark, an address book, and the like.

For example, in this application, the content provider may obtain, inreal time, an image collected in the viewfinder frame or the previewinterface, and display a processed image in the viewfinder frame or thepreview interface.

The view system includes visual controls, such as a control fordisplaying a text and a control for displaying an image. The view systemmay be configured to construct an application. A display interface mayinclude one or more views. For example, a display interface including anSMS message notification icon may include a text display view and animage display view.

For example, in this application, content such as “there is anobstruction in a current environment” that is displayed in a traininginterface may be displayed by the view system by receiving an indicationof the processor, to remind the user whether a current location issuitable to perform training.

The phone manager is configured to provide a communication function ofthe electronic device 100, for example, management of a call status(including answering, declining, or the like).

The resource manager provides various resources for an application, suchas a localized character string, an icon, a picture, a layout file, anda video file.

The notification manager enables an application to display notificationinformation in the status bar, and may be used to transmit anotification-type message. The displayed information may automaticallydisappear after a short pause without user interaction. For example, thenotification manager is configured to notify download completion, give amessage notification, and the like. The notification manager mayalternatively be a notification that appears in a top status bar of thesystem in a form of a graph or a scroll bar text, for example, anotification of an application that is run in the background, or may bea notification that appears on the screen in a form of a dialog window.For example, text information is prompted in the status bar, a prompttone is produced, the electronic device vibrates, or an indicator lightblinks.

The Android runtime includes a kernel library and a virtual machine. TheAndroid runtime is responsible for scheduling and management of theAndroid system.

The kernel library includes two parts: a function that needs to beinvoked in Java language and a kernel library of Android.

The application layer and the application framework layer are run on thevirtual machine. The virtual machine executes Java files of theapplication layer and the application framework layer as binary files.The virtual machine is configured to perform functions such as objectlifecycle management, stack management, thread management, security andexception management, and garbage collection.

The system library may include a plurality of function modules, forexample, a surface manager, a media library, a three-dimensionalgraphics processing library (for example, an open graphics library forembedded systems (OpenGL ES), and a 2D graphics engine (for example, aSkia database (SGL)).

The surface manager is configured to manage a display subsystem andprovide fusion of 2D and 3D layers for a plurality of applications.

The media library supports playback and recording in a plurality ofcommonly used audio and video formats, static image files, and the like.The media library may support a plurality of audio and video codingformats such as MPEG-4, H.264, MP3, AAC, AMR, JPG, and PNG.

The three-dimensional graphics processing library is configured toimplement three-dimensional graphics drawing, image rendering,composition, layer processing, and the like.

The 2D graphics engine is a drawing engine for 2D drawing.

The kernel layer is a layer between hardware and software. The kernellayer includes at least a display driver, a camera driver, an audiodriver, and a sensor driver.

For ease of understanding, with reference to the accompanying drawingsand an application scenario, the prompt method for fitness trainingprovided in the embodiments of this application is specificallydescribed in the following embodiments of this application by using anelectronic device with the structures shown in FIG. 1 and FIG. 2 as anexample.

It should be noted that FIG. 1 shows merely an example of the electronicdevice, and this is not particularly limited in this application. Thisapplication may be applied to an intelligent device such as a mobilephone or a tablet computer. This is not limited in this application. Indescriptions of the embodiments of this application, a mobile phone isused as an example for description.

To enable a user to normally perform training in a scenario in whichexercise space is limited, a suitable training location is recommendedto the user based on a training scenario and required training space.Therefore, the user can also normally perform training when the exercisespace is limited, for example, when there is an obstruction or the siteis insufficient.

For ease of understanding of this application, some human-computerinteraction embodiments in this application are first described.

FIG. 3(a) to FIG. 3(d) are schematic diagrams of an example of enteringa graphical user interface (GUI) of an application program according toan embodiment of this application. In this application, the mobile phoneis used as the electronic device to describe in detail the prompt methodprovided in this application.

FIG. 3(a) shows current interface content 301 that is possibly displayedby a screen display system of the mobile phone in an unlock mode of themobile phone. The interface content 301 is a home screen of the mobilephone. A plurality of third-party applications (App) are displayed inthe interface content 301, for example, Alipay, Task card store, Weibo,Gallery, WeChat, Settings, Camera, and Fitness. It should be understoodthat the interface content 301 may further include more otherapplications. This is not limited to the applications displayed.

In some embodiments, the home screen 301 of the mobile phone imposes nolimitation. The interface content displayed on the mobile phone may beinterface content displayed after the mobile phone responds to an inputoperation of the user, and the operation of the user may include anoperation that the user taps icons of some application programs in thehome screen displayed on the mobile phone, or an operation that the usertaps an icon in the interface content of an application programdisplayed on the mobile phone. For example, after the user taps anapplication program such as WeChat, Alipay, Task card store, Weibo,Gallery, Settings, and Fitness that are displayed on the home screen 301of the mobile phone, a display interface corresponding to eachapplication program is displayed.

For example, after detecting an operation that the user taps an icon 302of the Fitness application on the home screen 301, the mobile phone maystart the Fitness application, for example, may display an interfaceshown in FIG. 3(b). The interface may be referred to as an exercise itemselection interface 303. The exercise item selection interface 303 mayinclude icons of a plurality of exercise items such as hiking, running,cycling, aerobics, swimming, boxing, skiing, indoor fitness, and rowing.It should be understood that the exercise item selection interface 303may include icons of more, fewer, or other exercise items. This is notlimited to those applications mentioned.

Further, after the user taps the icons that are of the exercise itemsand that are displayed in the exercise item selection interface 303, agraphic user interface corresponding to each exercise item is displayed.For example, after detecting that the user taps an icon 304 of Indoorfitness in the exercise item selection interface 303, the mobile phonemay enter a display interface corresponding to Indoor fitness, forexample, it may display an interface shown in FIG. 3(c). The interfacemay be referred to as a training plan selection interface 305. Thetraining plan selection interface 305 may include a plurality oftraining plans, for example, “Dumbbell arm shaping”, “Body building—backmuscle training”, “Waist and abdomen advancement”, “Zero-based legshaping”, and “Whole-body stretching”. The plurality of training plansdisplayed in the training plan selection interface 305 may be trainingfor parts such as an arm, a back, a waist, an abdomen, a leg, ashoulder, a chest, a neck, and a whole body. It should be understoodthat the training plan selection interface 305 may include more, fewer,or other training plans. This is not limited to those training plansmentioned. Optionally, the user may use a finger to swipe on atouchscreen of the mobile phone. In response to the swipe operation ofthe user, the mobile phone may load more training plans and display thetraining plans in the training plan selection interface 305.

Further, after the user selects one of the training plans displayed inthe training plan selection interface 305, a graphic user interfacecorresponding to the selected training plan is displayed. For example,after detecting that the user taps the training plan “whole-bodystretching” in the training plan selection interface 305, the mobilephone may enter a corresponding display interface, for example, maydisplay an interface shown in FIG. 3(d). The interface may be referredto as a training start interface 306. The training start interface 306may include descriptions of the training plan, for example, a trainingpart, whether a device is required, a difficulty level, duration,to-be-consumed energy, and a training action. It should be understoodthat the training start interface 306 may include more, less, or otherdisplay content. The training start interface 306 may further include anicon 307, used to start a training process. After detecting that theuser taps the icon 307, the mobile phone may display or play, on thetouchscreen, a target course video corresponding to the training planselected by the user. It should be understood that in some embodiments,icon 307 could also be a button 307.

In recent years, the number of fitness enthusiasts has graduallyincreased. For people who have no time to go to a gym, intelligentfitness based on image processing may enable the user to enjoyprofessional guidance without leaving home. Specifically, in a trainingprocess of the user, the mobile phone may recognize a training action ofthe user, and then evaluate the training action of the user according toan image algorithm, for example, evaluate completion quality of the userbased on a key indicator of the training action, and point out anincorrect action and an improvement manner, to provide guidance for theuser, so that the user can exercise scientifically.

FIG. 4(a) shows interface content in a fitness solution based on imageprocessing. An interface 401 shown in FIG. 4(a) includes a target coursevideo and a viewfinder frame. The target course video may be a recordedcoach video. The user locally downloads the target course video inadvance, and performs a play, pause, or close operation on the targetcourse video when the mobile phone detects an instruction or a signal orresponds to an operation of the user. The viewfinder frame is used toobtain a view or recorded preview image, and display the preview imagein real time, for example, preview images that are of a trainingscenario and the user and that are shown in FIG. 4(a). In the fitnesssolution based on image processing shown in FIG. 4(a), when detectingthat the user appears in the viewfinder frame, the mobile phone performsa play operation on the target course video (that is, the user startstraining), and may further play sound in the target course video byusing a speaker, to notify the user of their training progress. When theuser performs training in a scenario in which exercise space is limited,for example, a living room scenario or a dormitory scenario, due to asize of the space and an obstruction that may appear, the user cannotperform training well. For example, the obstruction affects accuracy ofrecognizing an action according to an algorithm, and further affectsaccuracy of guidance provided for the user. Alternatively, if an actionin a large range exists in the training process, an accident may occuror the user needs to temporarily interrupt training. FIG. 4(b) showsinterface content in another fitness solution based on image processing.An interface 402 shown in FIG. 4(b) includes the target course video andthe viewfinder frame. In the fitness solution based on image processingshown in FIG. 4(b), the mobile phone may prompt the user with a locationto stand in a preview image displayed in the viewfinder frame. Forexample, the mobile phone displays a recommended-location box 403 in thepreview image. Only when detecting that the user is in therecommended-location box 403, the mobile phone performs a play operationon the target course video (that is, the user starts training). When theuser is not in the recommended-location box 403, training cannot bestarted. Similarly, when the user performs training in a scenario inwhich exercise space is limited, for example, a living room scenario ora dormitory scenario, due to a size of the space and an obstruction thatmay appear, the user cannot stand at a recommended location because anarticle such as a sofa, a desk lamp, or a tea table may appear in therecommended-location box 403, or an accident may occur in the trainingprocess because space recommended by the mobile phone is insufficient.Consequently, the user cannot normally perform training.

Therefore, this application provides a prompt method for fitnesstraining, so that in a scenario in which exercise space is limited, asuitable training location can be recommended to the user based on atraining scenario and required training space. Therefore, the user cannormally perform training when the exercise space is limited, forexample, when there is an obstruction or the site is insufficient.

FIG. 5(a) to FIG. 5(f) are schematic diagrams of a graphical userinterface in a prompt method according to an embodiment of thisapplication. As described above, after detecting that the user taps theicon 307, the mobile phone may enter a corresponding display interface,for example, may display an interface shown in FIG. 5(a). The interfacemay be referred to as a training interface 501. The training interface501 may include a target course video interface content 502, aviewfinder frame 503, and a camera field of view 504. A target coursevideo is displayed in the target course video interface content 502. Thetarget course video may be a recorded coach video, and is locallydownloaded or buffered by the user in advance (for example, downloadedor buffered to an external memory card or an internal memory of themobile phone). For example, after detecting that the user taps the icon307, the mobile phone automatically performs a downloading operation onthe target course video. The viewfinder frame 503 is used to obtain aview or recorded preview image, may display the preview image in realtime, and therefore may also be referred to as a preview interface. Aframing range of the viewfinder frame 503 is displayed in the previewinterface. As shown in FIG. 5(a), preview images of a training scenarioand the user are displayed in the viewfinder frame 503. Due to a displayrange of the touchscreen, the framing range displayed in the viewfinderframe 503 may be less than the camera field of view 504. The camerafield of view 504 is used to display, in real time, a picture obtainedby the camera and a location of the user in the acquired picture.Processed interface content may be displayed in the camera field of view504. The mobile phone may obtain a video frame of a current pictureacquired by the camera, process the video frame of the current pictureaccording to the image algorithm, and then display the processed videoframe in the camera field of view 504. For example, only an approximateshape instead of specific details of the user, a wall, a floor, a plant,or the like may be displayed in the camera field of view 504 in FIG.5(a).

In a possible implementation, after detecting that the user taps thecamera field of view 504, the mobile phone may enter a full-screendisplay interface of the camera field of view 504, for example, maydisplay an interface shown in FIG. 5(b). All of the touchscreen is usedto display the camera field of view 504. The user may determine, byusing the full-screen display interface of the camera field of view 504,the picture acquired by the camera and the location of the user in thepicture acquired by the camera. Optionally, the interface contentdisplayed in the camera field of view 504 may include a viewfinder frame503, used to display a framing range (or understood as a display rangethat is of the picture acquired by the camera and that is on thetouchscreen), a location and a size of the framing range in the pictureacquired by the camera, a ratio of the framing range to the pictureacquired by the camera, and the like.

It should be understood that locations that are on the touchscreen andthat are of the target course video interface content 502, theviewfinder frame 503, and the camera field of view 504 shown in FIG.5(a) and ratios of the target course video interface content 502, theviewfinder frame 503, and the camera field of view 504 to an area of thetouchscreen are merely an example. Locations, shapes, areas, and displayforms of the target course video interface content 502, the viewfinderframe 503, and the camera field of view 504 may be designed based on anactual requirement. This is not limited in this embodiment of thisapplication. It should be further understood that, in some embodiments,the training interface 501 may include only the viewfinder frame 503(that is, all of the touchscreen is used to display a preview image inreal time), or include the viewfinder frame 503 and the camera field ofview 504, and does not include the target course video interface content502. This is not limited in this embodiment of this application. Forease of understanding and description, an example in which the traininginterface 501 includes the target course video interface content 502,the viewfinder frame 503, and the camera field of view 504 is used fordescription in this embodiment of this application.

The camera in this embodiment of this application may be a depth camera(which may also be referred to as a three-dimensional (3D) camera), ormay be a conventional camera (which may also be referred to as atwo-dimensional (2D) camera or an RGB camera). The depth camera is acamera that may be used to measure a distance (a depth) from an objectto the camera, for example, a structured-light (structured lightincludes infrared speckle structured light, infrared stripe structuredlight, visible stripe structured light) depth camera based on activeprojection, a passive binocular camera (such as an RGB binocularcamera), and a camera based on a depth measurement principle usingreflection time (such as a time of flight (TOF) camera)). The depthcamera may be used to collect depth information of an environment, andthen perform object recognition, environment modeling, and the like.Compared with the conventional 2D camera, because one dimension of depthinformation is added, a real world can be better described. It should beunderstood that, after detecting that the user taps the icon 307, themobile phone automatically starts the camera application, and displaysthe preview image in the viewfinder frame 503.

After the target course video is downloaded or buffered, the mobilephone may process the target course video according to the imagealgorithm, and calculate maximum activity space required for exercise.The maximum activity space is used as one of the inputs used by themobile phone to recommend a suitable training location to the user. Forexample, the mobile phone may analyze and process an activity track of acoach in the target course video according to the image algorithm, andcalculate maximum activity space corresponding to each training actionperformed by the coach, to determine maximum activity space required forcompleting the target course video selected by the user. Alternatively,the mobile phone may analyze and process an activity track of a coach inthe target course video according to the image algorithm, to directlyobtain maximum activity space required for completing the target coursevideo selected by the user. It should be understood that a type (namely,calculated maximum activity space required by each training action orcalculated maximum activity space required by a set of training actions)of the maximum activity space that is required for exercise and that isdetermined by the mobile phone is related to the image algorithm used bythe mobile phone. The image algorithm used by the mobile phone toprocess the target course video is not specifically limited in thisembodiment of this application. It should be further understood that themaximum activity space required for exercise may be understood as thatthe user may complete a training action in the activity space. Themaximum activity space required for exercise may be a cylinder(depending on a diameter and a height), an elliptical cylinder(depending on an elliptical cross section and a height), a cube(depending on an edge length), a cuboid (depending on a length, a width,and a height), another regular or irregular three-dimensional shape, orthe like; or may be a circle, an ellipse, a square, a rectangle, anotherregular or irregular planar shape, or the like. When the maximumactivity space required for exercise is in a planar shape, the maximumactivity space may be understood as an activity range required when theuser takes exercise on the ground. The maximum activity space that isrequired for exercise and that is calculated by the mobile phone may beactivity space of the coach in the target course video, or may be amultiple of the activity space of the coach in the target course video.This is not limited in this embodiment of this application.

After entering the training interface 501, the mobile phoneautomatically starts the camera application. The mobile phone may obtaina current frame of image, process the current frame of image accordingto the image algorithm, and recognize a coordinate of a location of theuser in a current picture and/or calculate a location that meets arecommended activity space and that is in a current scenario. Therecommended activity space may be the maximum activity space that isrequired for exercise and that is obtained by the mobile phone afterprocessing the target course video, or may be a value obtained after themaximum activity space required for exercise is adjusted based on a bodyshape parameter of the user such as a height, a waist circumference, anda volume. Optionally, the mobile phone may process the current frame ofimage according to an image algorithm, to recognize the location of theuser in the current picture, and process the current image according toanother image algorithm, to obtain the location that meets therecommended activity space and that is in the current scenario.Optionally, the mobile phone may process the current frame of imageaccording to a same image algorithm, and may extract information aboutthe user while scanning the current scenario, to recognize the locationof the user in the current picture.

After calculating the location that meets the recommended activity spaceand that is in the current training scenario, namely, a traininglocation recommended by the mobile phone, the mobile phone may guide theuser to move to the training location recommended by the mobile phone.The foregoing process of processing both the target course video and thecurrent frame of image is completed inside the mobile phone. After thetraining location recommended by the mobile phone is obtained, therecommended training location or a prompt for guiding the user to moveto the recommended training location is displayed in a displayinterface.

In a possible implementation, the preview interface (the viewfinderframe 503) may include a recommended region, and the recommended regionis the training location recommended by the mobile phone. Therecommended region may be a three-dimensional region with depthinformation, for example, a recommended region 505 shown in FIG. 5(a),FIG. 5(c), and FIG. 5(e). The recommended region 505 may be displayed onthe ground in the preview image. For example, as shown in FIG. 5(e), theuser may move based on a location of the recommended region 505 untilthe user stands in a range of the recommended region 505.

In another possible implementation, the preview interface (namely, theviewfinder frame 503) may further include a prompt box. The prompt boxmay be used to remind the user whether there is an obstruction in acurrent environment or whether the user is already at the recommendedtraining location, or may be used to prompt the user with a movementdirection and/or a movement distance. For example, when a location ofthe user does not meet the activity space required for performingtraining or the user is not at the recommended training location, theprompt box may be used to display text content such as “there is anobstruction in the current environment”, “space is insufficient”, “acondition is not met”, or “not in the recommended region”, to remind theuser that the user cannot start training at the current location. Whenthe user is at the recommended training location, the prompt box may beused to display text content such as “a condition is met”, “already inthe recommended region”, or “start training”, or the prompt box may behidden or disappear, to remind the user that the user may start trainingat the current location. For another example, when the user is not atthe recommended training location, the prompt box may be used to displaytext content such as “move a little to the left”, “move one step to theleft”, or “move 20 cm to the right”, to prompt the user with themovement direction and/or the movement distance. When the user reachesthe recommended training location, the prompt box may be used to displaytext content such as “already in the recommended region”, “stay still”,or “OK”, or the prompt box may be hidden or disappear, to remind theuser that the user is already at the recommended training location andmay start training. For another example, when a location of the userdoes not meet the activity space required for performing training or theuser is not at the recommended training location, the prompt box may beused to display a graphic “×” to remind the user that the user cannotstart training at a current location. When the user is at therecommended training location, the prompt box may be used to display agraphic “√” to remind the user that the user may start training at thecurrent location. Optionally, when the user does not reach therecommended training location for a long time, for example, after apreset time (for example, 5 seconds) expires, the prompt box may be usedto display a graphic “!” to remind the user that the user has notreached the recommended training location before the preset timeexpired. It should be understood that the prompt box may be used todisplay a text, a graphic, or a combination of a text and a graphic.This is not limited in this embodiment of this application. It should benoted that in this embodiment of this application, when the user is notlocated in the recommended region or is not totally located in therecommended region, the mobile phone may consider that the user is notat the recommended training location. When the user is totally locatedin the recommended region, the mobile phone may consider that the useris at the recommended training location.

For example, as shown in FIG. 5(a), the viewfinder frame 503 includes aprompt box 506. The mobile phone may obtain a current video frame andthen process the current video frame, to calculate a location of theuser in the current environment. As shown in FIG. 5(b), because the userstands near a wall at a current moment, the space in which the user islocated is insufficient to perform training or the user is not in therecommended region 505. In this case, the prompt box 506 may be used todisplay “there is an obstruction in the current environment” and thegraphic “×” to remind the user that the current location is not suitableto perform training or the user is not in the recommended region 505. Asshown in FIG. 5(c) and FIG. 5(d), after a preset time expires after thecamera is started, the mobile phone obtains a video frame existing afterthe preset time expires and processes the video frame, to calculate alocation that is of the user in the environment and that exists afterthe preset time expires. If the space in which the user is located isstill insufficient to perform training or the user does not reach therecommended region 505, the prompt box may be used to display “there isan obstruction in the current environment” and the graphic “!” to remindthe user that the location that is of the user and that exists after thepreset time expires is not suitable to perform training or the user isnot in the recommended region 505. When the user moves to the traininglocation recommended by the mobile phone, for example, as shown in FIG.5(e) and FIG. 5(f), when the user totally stands in the recommendedregion 505, the prompt box may be used to display “there is noobstruction in the current environment” and the graphic “√” to remindthe user that training may be performed at a current location or theuser is already in the recommended region 505. Optionally, when the usermoves to the training location recommended by the mobile phone, theprompt box may disappear or be hidden after displaying “there is anobstruction in the current environment” and the graphic “√” for a shorttime.

Optionally, the prompt box 506 may be in a form of a pop-up box. Forexample, as shown in FIG. 5(a), FIG. 5(c), and FIG. 5(e), the prompt box506 may pop up from an edge of the touchscreen or may be retracted. Theprompt box 506 may be floating. For example, as shown in FIG. 5(b), FIG.5(d), and FIG. 5(f), the prompt box 506 may directly appear or be hiddenat a preset location, for example, a middle location above the displayinterface or the center of the display interface.

For example, as shown in FIG. 6(a), after obtaining the location of theuser in the current environment, the mobile phone may determine adirection and/or a distance in which the user needs to move, based onthe current location (for example, a current coordinate of a location ofthe user) of the user and the training location (for example, acoordinate of a location of the center of the recommended region)recommended by the mobile phone. As shown in FIG. 6(a), the prompt box506 is used to display “move a little to the left” and the graphic “×”.After the preset time expires, the mobile phone obtains the location ofthe user in the environment, and determines again, based on the locationof the user and the training location recommended by the mobile phone,the direction and/or the distance in which the user needs to move. Ifthe user is still not at the recommended training location, as shown inFIG. 6(b), the prompt box 506 may be used to display “move a little tothe left” and the graphic “!”. If the user moves to the traininglocation recommended by the mobile phone, the mobile phone determines,based on the location of the user and the training location recommendedby the mobile phone, that the user does not need to move (for example,when a difference between the coordinate of a location of the user andthe coordinate of a location of the center of the recommended region isless than a threshold, the mobile phone may determine that the user doesnot need to move). As shown in FIG. 6(c), the prompt box 506 may be usedto display “move a little to the left” and the graphic “√”. It should beunderstood that the movement direction with which the mobile phoneprompts the user may be based on the user. For example, “move a littleto the left” displayed in the prompt box 506 is used to prompt the userto move to the left of the user. It should be further understood thatthe movement direction with which the mobile phone prompts the user maybe determined based on the location of the user in the currentenvironment and the training location recommended by the mobile phone.The movement direction is not limited to movement to the left and theright, and may be movement to the front, the back, the left front, theright back, or the like. A manner in which the mobile phone prompts theuser with the movement direction and/or the movement distance is notlimited to a text prompt, or may be a graphic prompt and/or a voiceprompt. For example, as shown in FIG. 7(a), the mobile phone may displaya graphic prompt such as a direction icon 507 to prompt the user withthe direction and/or the distance in which the user needs to move.Alternatively, as shown in FIG. 7(b), a speaker icon 508 may bedisplayed in an interface of the mobile phone, to indicate that themobile phone prompts, by using the speaker, the user with the directionand/or the distance in which the user needs to move.

In a process in which the mobile phone guides the user to move to therecommended training location, the mobile phone may perform region ofinterest (ROI) adaptive adjustment for the camera, that is, a picture inwhich the user is located in the center of the framing range is alwaysdisplayed in the viewfinder frame.

Optionally, a wide-angle camera that can obtain a larger field of viewmay be used as the camera, so that the camera can be fixed. In amovement process of the user, the camera may perform ROI adaptiveadjustment, so that the user is always in the center of the framingrange. In some other embodiments, a rotatable camera may be used as thecamera, that is, a lens of the camera may be rotated by a mechanicalstructure to obtain a larger field of view. In this way, in a movementprocess of the user, the camera may also rotate as the user moves, sothat the user is always in the framing range or always in the center ofthe framing range. For example, the camera may rotate as the user moves,so that the user is always in the center of the framing range.Alternatively, the camera may rotate when the user reaches an edge ofthe viewfinder frame, so that the user is always in the framing range.Alternatively, in a movement process of the user, the camera performsROI adaptive adjustment to keep the user in the center of the framingrange, and the camera rotates when the user moves to an edge of theviewfinder frame, to continue to keep the user in the center of theframing range. The wide-angle camera, the rotatable camera, or the likethat can obtain a larger field of view can be used to expand a selectionrange of the training location recommended to the user, to ensure thattraining is normally performed. For example, when the rotatable camerais used, and a width of a training scenario in which the user is locatedis insufficient to include a whole body of the user into a display rangeor there are a large quantity of obstructions, the camera may rotate byusing a rotatable mechanical mechanism, to expand a recommendation rangefor locations to stand, and ensure that training is normally performed.

Before the user moves to the recommended region, the target course videois not played. After the mobile phone detects that the user is at thetraining location recommended by the mobile phone, for example, therecommended region 505, the training interface 501 further includesinterface content for training start confirmation. The mobile phone mayprompt the user, in a form of action recognition, gesture recognition,voice recognition, countdown timing, Bluetooth confirmation, and thelike, to confirm to start training.

In a possible implementation, the mobile phone may display a specifiedaction and a prompt text in the display interface, to prompt the user tocomplete the specified action to start training. As shown in FIG. 8(a),the training interface 501 further includes an action recognition icon509 used to prompt the user to complete the specified action to starttraining After detecting that the user completes the specified action,for example, raises both hands, the mobile phone may perform a playoperation on the target course video. The mobile phone may recognize thespecified action according to an action matching algorithm. However, itshould be understood that the mobile phone may detect, according toanother algorithm, whether the user completes the specified action. Thisis not limited in this embodiment of this application.

In a possible implementation, the mobile phone may display a gesture anda prompt text in the display interface, to prompt the user to completegesture recognition to start training. As shown in FIG. 8(b), thetraining interface 501 further includes a gesture recognition icon 510used to prompt the user to complete gesture recognition to starttraining After detecting that the user completes a specified gesture,for example, spreads five fingers, the mobile phone may perform a playoperation on the target course video. The mobile phone may recognize thespecified gesture according to a gesture matching algorithm. However, itshould be understood that the mobile phone may detect, according toanother algorithm, whether the user completes the specified gesture.This is not limited in this embodiment of this application.

In another possible implementation, the mobile phone may display aninstruction recognition icon in the display interface, to prompt theuser to speak a specified command to start training. As shown in FIG.8(c), the training interface 501 further includes an instructionrecognition icon 511 used to prompt the user to speak the specifiedcommand to start training. After a microphone of the mobile phonedetects the voice of the user and recognizes a correct instruction, forexample, a “start” instruction, the mobile phone may perform a playoperation on the target course video. The mobile phone may recognize thespecified command according to a voice recognition algorithm. However,it should be understood that the mobile phone may detect, according toanother algorithm, whether the user speaks a correct command This is notlimited in this embodiment of this application. It should be furtherunderstood that an instruction used for instruction recognition may beby default at delivery of the mobile phone or may be defined by theuser. This is not specifically limited in this embodiment of thisapplication.

In another possible implementation, the mobile phone may display acountdown timing icon in the display interface, to prompt the user tostart training after countdown timing ends. As shown in FIG. 8(d), thetraining interface 501 further includes a countdown timing icon 512 usedto prompt the user to start training after 5 seconds. After countdowntiming ends, for example, after the countdown timing icon is displayedas “0”, the mobile phone may perform a play operation on the targetcourse video.

In still another possible implementation, the mobile phone may display aconfirmation window in the display interface, to prompt the user toconfirm whether to start training. As shown in FIG. 8(e), the traininginterface 501 further includes a confirmation window 513 used to promptthe user whether to start training. After detecting that a tappingoperation is performed on a “confirm” option, the mobile phone mayperform a play operation on the target course video. It should beunderstood that the user may perform the tapping operation by tappingthe “confirm” option in the confirmation window 513, or may perform thetapping operation on the “confirm” option in the confirmation window 513by using a button on a Bluetooth headset. This is not limited in thisembodiment of this application.

After the mobile phone detects a signal indicating that the userconfirms to start training, the mobile phone may lock the framing rangeof the camera, to keep the user in the center of the viewfinder frame,and ensure that a picture range displayed on the touchscreen no longerchanges in an exercise process.

After the target course video is played, the user may perform trainingby following the coach in the target course video or based on guidanceof the target course video. One target course video may include aplurality of training actions. Optionally, the training locationrecommended by the mobile phone to the user may be compatible with alltraining actions. As shown in FIG. 9(a), the recommended region 505 maybe calculated by the mobile phone based on a training action thatrequires maximum activity space and that is in a plurality of trainingactions. Because the recommended region 505 may enable the user tocomplete all training actions, the location of the recommended region505 may remain unchanged in the entire training process.

Optionally, the training location recommended by the mobile phone to theuser may be for a corresponding training action. For example, as shownin FIG. 5(a) to FIG. 5(f), the recommended region 505 may be calculatedby the mobile phone based on maximum activity space required by thefirst training action in the target course video. Before each trainingaction is completed, the mobile phone may recommend a training locationto the user for the training action. As shown in FIG. 9(b), therecommended region 505 may be calculated by the mobile phone foractivity space required by a current training action “bow-stepstretching”. After a previous training action is completed, the mobilephone may perform a pause operation on the target course video,determine a location that is of the recommended region 505 used tocomplete “bow-step stretching” and that is in a current scenario, guidethe user to the recommended region 505, and then perform a playoperation on the target course video, to guide the user to complete“bow-step stretching”. It should be understood that, for each trainingaction, for interface content used when the mobile phone guides the userto a corresponding recommended region and interface content used toprompt the user to confirm to start training, refer to the foregoingdescriptions. Details are not described herein again. The mobile phonemay recommend a suitable training location to the user for each trainingaction, so that the user can also normally perform training in a complextraining scenario. For example, in a scenario in which exercise space isextremely limited, for a training action that cannot be completed, suchas a training action that requires large activity space, the mobilephone may not recommend a training location to the user to skip thetraining action, and provide, for the user, an action suitable fortraining in the scenario, so that the user can normally take fitnessexercise. This improves user experience.

Optionally, if the mobile phone detects that the user still does notreach, after a waiting time expires, the location recommended by themobile phone, for example, because a range of the recommended region isjust equal to the activity space required by a training action, the useris extremely prone to exceed the recommended region or the user does notexpect to complete a current training action and intentionally does notmove in response to a prompt of the mobile phone, the mobile phone mayskip the training action to perform a next training action. As shown inFIG. 9(c), the recommended region 505 may be calculated by the mobilephone for activity space required by a current training action “dynamicinner-thigh stretching”. After a previous training action is completed,the mobile phone performs a pause operation on the target course video,and determines a location that is of the recommended region 505 used tocomplete “dynamic inner-thigh stretching” and that is in a currentscenario. In a process of guiding the user to the recommended region505, the prompt box 506 is always used to remind the user that the useris not in the recommended region. After the waiting time expires, themobile phone may perform a fast-forward or skip operation on the targetcourse video, to skip the current training action “dynamic inner-thighstretching” to perform a next training action.

The training location recommended by the mobile phone to the user may betwo-dimensional. For example, provided that the user is located in therecommended region displayed on the ground, the mobile phone maydetermine that the user has reached the recommended training location.The training location recommended by the mobile phone to the user may bethree-dimensional, for example, a cylinder. The user needs to be in therecommended region displayed on the ground, and a body of the userfurther needs to be in the cylinder. In this case, the mobile phone maydetermine that the user has reached the recommended training location.Optionally, the three-dimensional training location recommended by themobile phone to the user may be a cylinder, an elliptical cylinder, acube, or the like. This is not limited in this embodiment of thisapplication.

In the foregoing implementation, the mobile phone may intelligentlyrecommend the training location to the user based on the trainingscenario and the required training space, and the user does not need toselect, based on space required by a course, a location for performingtraining, to avoid a case in which training cannot be performed due toinsufficient space. Further, the mobile phone may further guide the userto the recommended training location in one or more prompt forms, andthe user does not need to determine the training location. This improvesuser experience, and ensures that the user can also normally performtraining in a scenario in which exercise space is limited.

Optionally, in some embodiments, the mobile phone may recommend acombination of a target course video and a training action to the userbased on a training scenario, and recommend a suitable training locationto the user, so that the user performs training based on the recommendedcombination of the target course video or the training action. Thefollowing is described in detail with reference to FIG. 10(a) to FIG.11(b).

FIG. 10(a) to FIG. 11(b) show schematic diagrams of entering a graphicaluser interface of an application program. FIG. 10(a) and FIG. 10(b) arethe same as FIG. 3(a) and FIG. 3(b). For specific descriptions, refer tothe foregoing descriptions. Only the differences between the interfacecontent are described below. As shown in FIG. 10(c), the training planselection interface 305 may further include a training plan additioncontrol icon 308 (namely, a “+” control). After the user taps thetraining plan addition control icon 308, a training plan addition windowmay pop up, for example, a training plan addition window 309 shown inFIG. 10(d) may be displayed. The training plan addition window 309 mayinclude a recommendation icon 310. After detecting that the user tapsthe recommendation icon 310 in the training plan addition window 309,the mobile phone may enter a corresponding display interface, forexample, may display a recommendation interface 311 shown in FIG. 11(a).The recommendation interface 311 may include a viewfinder frame 312 andrecommended content 313. The recommended content 313 may include atraining course and/or a training action that are/is recommended by themobile phone to the user. The recommended training course and/or therecommended training action in the recommended content 313 are/isdetermined by the mobile phone based on the training scenario. Forexample, the mobile phone obtains a video frame of a current environmentand processes the current video frame, to calculate one or morerecommended locations that meet a minimum activity space (or presetactivity space). The mobile phone may further obtain in advance themaximum activity space required by all training courses and/or alltraining actions, and determine, based on the one or more recommendedlocations that meet the minimum activity space and the maximum activityspace required by all the training courses and/or all the trainingactions, a training course and/or training action that can be used toperform corresponding training at the one or more recommended locationsthat meet the minimum activity space. The training course and/or thetraining action are/is a recommended training course and/or arecommended training action that are/is displayed by the mobile phone inthe recommended content 313. Therefore, when detecting an operation thatthe user taps a training course or a training action in the recommendedcontent 313, the mobile phone may enter a corresponding displayinterface in response to the tapping operation of the user, for example,may display the training interface 501 shown in FIG. 5(a). In thetraining interface 501, the mobile phone may prompt, in a manner such asa prompt box, a direction icon, voice, or a recommended region displayedon the ground, the user with a recommended training locationcorresponding to the training course or the training action selected bythe user, and guide the user to the recommended training location. Amanner in which the mobile phone guides the user to move to therecommended training location is similar to the foregoing descriptions.For details, refer to the foregoing descriptions. Details are notdescribed herein again. It should be understood that display interfacesin which the training plan addition control icon 308 and the trainingplan addition window 309 are located are merely an example. The trainingplan addition control icon 308 and the training plan addition window 309may be displayed in any display interface after the fitness applicationis entered and before the training interface 501 is displayed on thetouchscreen. This is not limited in this embodiment of this application.It should be understood that in some embodiments icon 308 could also bea button 308.

In this embodiment of this application, the mobile phone may determine,based on a training scenario, a training location that can meet atraining condition, and may recommend, to the user based on obtained amaximum activity space required by a training course and/or a trainingaction, a target training course or a training action that is suitableto perform training in the training scenario. The user does not need toselect the target training course based on the scenario. This avoids acase in which the target training course selected by the user cannot beused to perform training in the current scenario.

In a possible implementation, a size of the required training space maybe defined by the user. After detecting that the user taps therecommendation icon 310 in the training plan addition window 309, themobile phone may enter a corresponding display interface, for example,may display a recommendation interface 311 shown in FIG. 11(b). Therecommendation interface 311 may include a user-defined window 314, andthe user may set the size of the required training space in theuser-defined window 314. For example, the user may tap a black invertedtriangle button in the user-defined window 314. In response to thetapping operation of the user, the mobile phone may display auser-defined type selection box 315 in the recommendation interface 311.In response to an operation that the user taps different types, themobile phone displays a corresponding input prompt in an input region316. As shown in FIG. 11(b), a user-defined type may be “a diameter anda height” by default, and the user may input data at diameter and heightlocations in the input region 316. After the user taps a “confirm”option, a corresponding display interface is entered, for example, therecommended content 313 shown in FIG. 11(a) is displayed. Further, theuser may select, from the recommended content 313, a training course ora training action that the user expects to perform. In response to anoperation of the user, the mobile phone may display a correspondinginterface and perform a corresponding operation. For details, refer tothe foregoing descriptions. Details are not described herein again.

In this embodiment of this application, the user may independentlydetermine a size of a space required for exercise, and then the mobilephone recommends, to the user based on a training scenario and the spacerequired by the user, a target training course and/or an action thatare/is suitable to perform training in the scenario and that meet/meetsa user requirement, so that the user requirement can be met in a moretargeted manner and user experience can be improved.

Optionally, in some other embodiments, the mobile phone may recommend acombination of a target course video or a training action to the userbased on a training scenario and a body shape parameter of the user suchas a height, a waist circumference, and a volume, and recommend asuitable training location to the user, so that the user performstraining based on the recommended combination of the target course videoor the training action. Because the recommended combination of thetarget course video or the training action is recommended based on thebody shape parameter of the user, the recommended combination of thetarget course video or the training action is more personalized, and theuser better performs training based on the recommended combination ofthe target course video or the training action in the current trainingscenario. For example, the mobile phone obtains a video frame of acurrent environment and processes the current video frame. For example,the mobile phone may recognize the user, and determine a parameter ofthe user such as a height, a waist circumference, and a volume, todetermine space for accommodating a body of the user. In addition, themobile phone may calculate one or more recommended locations that meet aminimum activity space and/or space that may accommodate the body shapeof the user. In addition, the mobile phone may further obtain in advancea maximum activity space required by all training courses and/or alltraining actions, and determine, based on the one or more recommendedlocations that meet the minimum activity space and/or the space that mayaccommodate the body shape of the user and the maximum activity spacerequired by all the training courses and/or all the training actions, atraining course and/or a training action that can be used to performcorresponding training at the one or more recommended locations thatmeet the minimum activity space and/or the space that may accommodatethe body shape of the user. For example, the mobile phone may display aninterface shown in FIG. 11(a), and display, in recommended content 313,the training course and/or the training action that are/is recommendedbased on the training scenario and the body shape of the user.

In some embodiments, in a process to determine where the user shouldstand, that is, in a process from starting the camera application by themobile phone to movement of the user to the training locationrecommended by the mobile phone, the mobile phone may obtain a pluralityof frames of images of the user, perform subject recognition on the userbased on the plurality of frames of images, for example, recognize askeleton point of the user, and perform an affine transformation on therecognized skeleton point, to ensure that action matching is notaffected by an angle, and ensure that a change of the angle of the userrelative to a picture does not affect accuracy of the training actionevaluation.

With reference to FIG. 3(a) to FIG. 11(b), the foregoing describes ahuman-computer interaction embodiment of the prompt method provided inthe embodiments of this application. For better understanding of theprompt method provided in this application, the following describes aspecific implementation process and an algorithm from an implementationperspective.

FIG. 12 is a schematic diagram of a processing process of a promptmethod according to an embodiment of this application. In a specificimplementation process, the prompt method may include the followingsteps.

601. Determine a current location of a user in a training scenario.

It should be understood that determining the current location of theuser in the training scenario means recognizing the user in a field ofview of a camera. Subject recognition means recognition of a type and alocation of an object in an image. That is, a type and a coordinate boxof the object are recognized in an output interface. Similarly, in thisapplication, recognizing the user means recognizing the user in thefield of view of the camera, and determining a coordinate of a locationof the user in the field of view of the camera, namely, the currentlocation of the user in the training scenario. A mobile phone mayrecognize the user according to a preset algorithm, and the algorithmfor recognizing the user is not limited in this application. Forexample, the mobile phone may determine the coordinate of a location ofthe user by recognizing a skeleton point (or referred to as skeletonrecognition) of the user according to an image algorithm, or may extractinformation about the user based on three-dimensional depth information,to determine the coordinate of a location of the user. As shown in FIG.5(a) to FIG. 5(e), the mobile phone may display the recognized skeletonpoint in the training interface 501.

602. Recommend a suitable training location based on the trainingscenario and required training space.

The mobile phone may determine the required training space based on anactivity space of a coach in a target course video. For example, themobile phone may determine that a maximum activity space required by atraining action in the target course video or a multiple of the maximumactivity space is the required training space. For example, the targetcourse video includes a plurality of training actions. The mobile phoneuses, as the required training space, activity space corresponding to atraining action that requires maximum activity space and that is in theplurality of training actions or a multiple of the activity space. Therequired training space may be compatible with all training actions, andthe user may complete all training actions in the target course video inthe required training space.

The mobile phone may determine the required training space for eachtraining action in a plurality of training actions. For example, atarget course video includes a plurality of training actions. The mobilephone may calculate space required by each training action, and use thespace required by each training action or a multiple of the space as therequired training space of each training action. In this way, the mobilephone may recommend a training location corresponding to each trainingaction to the user based on the required training space of each trainingaction.

The mobile phone may determine the required training space based on abody shape parameter of the user. For example, the mobile phone maydetermine the required training space based on a body shape of the usersuch as a height and a waist circumference. For example, the mobilephone determines, as the required training space, space occupied whenthe user extends both arms.

The mobile phone may determine the required training space based on anactivity space of a coach in a target course video and a body shapeparameter of the user. For example, after a maximum activity spacerequired by a training action in the target course video is obtained,the maximum activity space required by the training action in the targetcourse video is adjusted based on the body shape parameter of the usersuch as a height and a waist circumference, to obtain the requiredtraining space. The required training space is determined based on abody shape of the user, so that the recommended training location ismore personalized.

Optionally, the mobile phone may process an activity track of the coachin the target course video, to obtain a maximum activity space requiredby each training action and/or maximum activity space for completing allthe training actions in the target course video.

In an implementation, the required training space may be preset ordefined by the user. Specifically, for a user-defined manner, refer toFIG. 11(b). Details are not described herein again. The userindependently determines a size of a space required for exercise, sothat a user requirement can be met in a more targeted manner and theuser experience can be improved.

When the user defines the required training space, the required trainingspace may be a two-dimensional planar graphic such as a circle, anellipse, a square, a rectangle, or another regular or irregular graphic.A parameter of the required training space may be represented as, forexample, an area, a length and a width, or a diameter. The requiredtraining space may be in a three-dimensional shape such as a cylinder,an elliptical cylinder, a cuboid, a cube, or another regular orirregular three-dimensional shape. A parameter of the required trainingspace may be represented as, for example, a length, a width, and aheight, or a diameter and a height. This is not limited in thisembodiment of this application.

After obtaining the required training space, the mobile phone needs torecommend a suitable training location to the user based on the requiredtraining space and the training scenario. In other words, afterobtaining the training space required for training by the user, themobile phone needs to determine a location that can meet the requiredtraining space and that is in the training scenario in which the user islocated, to facilitate training by the user. The mobile phone may scan acurrent environment (also referred to as a current scenario) by using adepth camera, and calculate, according to a preset algorithm, a locationthat meets the required training space and that is in the trainingscenario. The location is the training location recommended by themobile phone. Optionally, there may be plurality of training locationsthat meet the required training space. The mobile phone may determine alocation closest to the user as the training location recommended to theuser, or select any location and determine the location as the traininglocation recommended to the user, or the user selects one of thelocations as the recommended training location. This is not limited inthis embodiment of this application.

Optionally, steps of recognizing the location of the user by the mobilephone and scanning the training scenario by the mobile phone may beseparate. For example, an algorithm for recognizing the location of theuser by the mobile phone and an algorithm for scanning the trainingscenario by the mobile phone may be different. The mobile phone extractsthe information about the user according to an algorithm, to recognizethe location of the user in the training scenario, and scans thetraining scenario according to another algorithm, to obtain informationabout the training scenario. In some other embodiments, the mobile phonemay recognize the location of the user and scan the training scenario byusing one step. For example, when the mobile phone scans the trainingscenario, the mobile phone may recognize the location of the user. Analgorithm for scanning the training scenario by the mobile phone mayalso be used to extract the information about the user to recognize thelocation of the user in the training scenario. Specific algorithms forrecognizing the location of the user and scanning the training scenarioby the mobile phone are not limited in this embodiment of thisapplication.

Optionally, to expand a recommended location range for the user tostand, in this embodiment of this application, a wide-angle camera or arotatable camera may be used as the camera. The wide-angle camera has awide angle of view, and can accommodate a larger scene range within alimited distance. The camera with the rotatable lens may performphotography in a larger scene range by using the rotatable lens. After alarger field of view is obtained, the location to stand recommendationrange can be expanded, and a suitable training location can be foundmore easily.

603. Guide the user to move to the recommended training location.

After determining the training location recommended to the user, themobile phone may display, in a preview interface or a viewfinder frame,the training location recommended by the mobile phone. For example, themobile phone may prompt the user with the recommended training locationin a recommended region displayed on the ground, for example, therecommended region 505 in FIG. 5(a) to FIG. 5(f).

The user may move based on the recommended training location displayedin the preview interface. In some embodiments, the mobile phone mayguide the user to move to the recommended training location in a formsuch as voice, a prompt box, a direction icon, or a recommended regiondisplayed on the ground. For example, the mobile phone reminds the userthat there is an obstruction in the current environment, reminds theuser whether the user is in the recommended region, or prompts the userwith a movement direction and/or a movement distance. For a specificmanner of guiding the user and the display interface, refer to FIG. 5(a)to FIG. 7(b) and the related descriptions. Details are not describedherein again.

In a specific implementation process, the mobile phone obtains thecoordinate of a location of the user in the current environment and thetraining location recommended by the mobile phone, and may determine,based on a distance difference between a coordinate of the currentlocation of the user and a coordinate of the recommended traininglocation (for example, a coordinate of the center location in therecommended region), whether the user reaches the recommended traininglocation, or may determine the direction and/or the distance in whichthe user needs to move. For example, when the distance differencebetween the coordinate of the current location of the user and thecoordinate of the recommended training location (for example, thecoordinate of the center location in the recommended region) is greaterthan a preset threshold, the mobile phone may determine that the user isnot at the recommended training location, and the mobile phone guides inany one or a combination of manners such as a prompt box, a directionicon, voice, and a recommended region displayed on the ground, the userto move to the recommended training location. When the distancedifference between the coordinate of the current location of the userand the coordinate of the recommended training location (for example,the coordinate of the center location in the recommended region) is lessthan a preset threshold, the mobile phone may determine that the user isat the recommended training location. The mobile phone may remind theuser, in any one or a combination of manners such as a prompt box, adirection icon, voice, and a recommended region displayed on the ground,that the user has reached the recommended training location, or remindthe user, in a manner such as a prompt box, a direction icon, voice, orhiding or disappearing of a recommended region displayed on the ground,that the user has reached the recommended training location.

In this embodiment of this application, a field of view and a framingrange of the camera may be different. For example, when the wide-anglecamera is used, the field of view of the camera may be 5 m, and theframing range may be only 1 m. Therefore, the field of view of thecamera cannot be totally displayed on a touchscreen, and only an imagein the framing range is displayed. In a process in which the user moves,the camera may perform region of interest (ROI) adaptive adjustment, sothat a picture that is of the user and that is in the center of theframing range is always displayed.

604. When determining that the user moves to the recommended traininglocation, the mobile phone confirms that the user is ready to starttraining.

Optionally, when the mobile phone determines that the user moves to therecommended training location, the mobile phone recognizes a specifiedaction according to an action matching algorithm. After recognizing thatthe user completes the specified action, the mobile phone confirms thatthe user is ready to start training. For example, the mobile phone maydisplay the specified action and/or a text prompt in the previewinterface, to prompt the user to complete the specified action. For aspecific action recognition display interface, refer to FIG. 8(a) andthe related descriptions. Details are not described herein again.

Optionally, when the mobile phone determines that the user has moved tothe recommended training location, the mobile phone recognizes aspecified gesture according to a gesture recognition algorithm. Afterrecognizing that the user completes the specified gesture, the mobilephone confirms that the user is ready to start training For example, themobile phone may display the specified gesture and/or a text prompt inthe preview interface, to prompt the user to complete the specifiedgesture. For a specific gesture recognition display interface, refer toFIG. 8(b) and the related descriptions. Details are not described hereinagain.

Optionally, when the mobile phone determines that the user has moved tothe recommended training location, the mobile phone recognizes aspecified command according to a voice recognition algorithm. Afterrecognizing that the user speaks the specified command, the mobile phoneconfirms that the user is ready to start training For example, themobile phone may display an instruction recognition icon and/or a textprompt in the preview interface, to prompt the user to speak thespecified command For a specific voice recognition display interface,refer to FIG. 8(c) and the related descriptions. Details are notdescribed herein again.

Optionally, when the mobile phone determines that the user has moved tothe recommended training location, the mobile phone starts a timer, forexample, performs countdown timing. When timing ends, the mobile phoneconfirms that the user is ready to start training. For example, themobile phone may display a countdown timing icon and/or a text prompt inthe preview interface, to prompt the user to start training aftercountdown timing ends. For a specific display interface, refer to FIG.8(d) and the related descriptions. Details are not described hereinagain.

Optionally, when the mobile phone determines that the user has moved tothe recommended training location, the mobile phone displays aconfirmation window in an interface. When detecting a confirmationsignal, the mobile phone confirms that the user is ready to starttraining. For example, the mobile phone may display the confirmationwindow in the preview interface. For a specific display interface, referto FIG. 8(e) and the related descriptions. Details are not describedherein again.

605. Lock the framing range of the camera, to keep the user in thecenter of the framing range.

To ensure that a picture range does not change in the user movementprocess, after determining that the user is ready to start training, themobile phone locks the framing range of the camera, to keep the user inthe center of the framing range. It should be understood that, in thisembodiment of this application, keeping the user in the center of theframing range of the camera may be understood as keeping the user in thecenter of the viewfinder frame in the display interface.

606. Perform an affine transformation on the recognized user based on aplurality of frames of images.

The plurality of frames of images may be obtained in the process inwhich the user moves to the recommended training location. Affinetransformation (affine transformation) is a linear transformation from atwo-dimensional coordinate to a two-dimensional coordinate, andmaintains “colinearity” (that is, a straight line is still a straightline after transformation) and “parallelism” (that is, a relativelocation relationship between two-dimensional graphics remainsunchanged, parallel lines are still parallel lines, and an order oflocations of points on a straight line remains unchanged) of atwo-dimensional graphic. In a process of determining where the usershould stand, that is, in a process from starting the camera applicationby the mobile phone to movement of the user to the training locationrecommended by the mobile phone, the mobile phone may obtain a pluralityof frames of images of the user, perform subject recognition on the userbased on the plurality of frames of images, for example, recognize askeleton point of the user, and perform an affine transformation on therecognized skeleton point, to ensure that action matching is notaffected by an angle, and ensure that a change of the angle of the userrelative to a picture does not affect accuracy of training actionevaluation.

In conclusion, in the prompt method provided in this application, asuitable training location is intelligently recommended to the userbased on the training scenario and the required training space, and thecurrent location of the user in the training scenario is calculated, sothat the user can be guided to the recommended training location.Therefore, the user can normally perform training in a scenario in whichexercise space is limited.

FIG. 13 is a schematic diagram of a specific processing process of aprompt method according to an embodiment of this application. Referringto FIG. 13, the method includes the following steps.

After a user taps a start control, in response to the tapping operationof the user, a mobile phone automatically starts a camera application,displays a viewfinder frame in a display interface, and displays previewimages of the user and a training scenario in the viewfinder frame.

701. Perform down-sampling on a current video frame, and input thecurrent video frame into a model.

After obtaining the current video frame, the mobile phone performsdown-sampling on the current video frame, and inputs the current videoframe into an image processing model. The image processing model is usedto recognize the user in the current video frame. The image processingmodel for recognizing the user is not limited in this embodiment of thisapplication.

702. Recognize a skeleton point of the user according to an imagealgorithm.

In this embodiment of this application, the user may be recognized byusing a “skeleton point recognition technology”. The “skeleton pointrecognition technology” is also referred to as a “body detectiontechnology”, and is a process in which a location of a joint of a humanbody may be estimated from an image or a video by using a computervision technology. An image that includes a human body is given, toaccurately position a location of each joint of the human body in theimage, for example, an elbow joint, a wrist joint, and a knee joint. Thepositioned joints may finally form a skeleton diagram of the human body,so that information such as a current posture of the human body can bereflected. With the “skeleton point recognition technology”, a postureof the user can be more accurately recognized, to determine an accuratelocation of the user. As shown in FIG. 5(a) to FIG. 5(f), the dotdisplayed at the location of the joint of the user in the viewfinderframe 501 is a recognized skeleton point.

703. Calculate a current location of the user in the training scenario.

The current location of the user in the training scenario is calculatedbased on the skeleton point recognized in step 702. Specifically, acoordinate of a location of the user in a current picture may becalculated.

704. Recommend a size of a training site based on a target course video.

The target course video may be downloaded or buffered by the user to themobile phone in advance. The mobile phone may process the target coursevideo, calculate maximum activity space required for completing alltraining actions in the target course video, and determine, based on themaximum activity space required for completing all the training actionsin the target course video, the size that is of the training site andthat is recommended to the user. It should be understood that the targetcourse video may include a plurality of training actions. The mobilephone may analyze and process an activity track of a coach in the targetcourse video, determine a maximum activity space required by eachtraining action in the plurality of training actions, and determine amaximum value in the required maximum activity space as the maximumactivity space required for completing all the training actions in thetarget course video.

In this step, the mobile phone may select, for the user, a site on whichall the training actions in the target course video can be completed, sothat the user can complete a training process on the training sitewithout determining the training site again.

Optionally, the size of the training site may be represented by using anarea. To be specific, when a ground area in the training scenario meetsa value, the mobile phone may recommend the location as the trainingsite, regardless of whether there is an obstruction in space at thelocation.

705. Calculate training space required by a current action.

The target course video may include a plurality of training actions, andthe mobile phone may calculate training space required by each trainingaction. Before the user completes a current training action, the mobilephone calculates the training space required by the current action.

Optionally, the training space required by the current action is athree-dimensional space.

706. Recommend a suitable training location.

The mobile phone recommends a suitable training location to the useraccording to an algorithm based on the training scenario and thetraining space required by the current action. For example, the mobilephone may calculate a coordinate of a location at which the user mayperform training.

It should be understood that the operation that the mobile phoneperforms steps 701 to 703 and the operation that the mobile phoneperforms steps 704 to 706 may be performed simultaneously, or may beperformed based on a sequence. This is not limited in this embodiment ofthis application.

707. Guide the user to move to the recommended training location.

The user may be guided, in a manner such as a notification prompt, avoice prompt, and display of a recommended region in the displayinterface of the mobile phone, to move to the recommended traininglocation. For a specific manner of guiding the user and the displayinterface, refer to FIG. 5(a) to FIG. 7(b) and the related descriptions.Details are not described herein again.

708. In a movement process of the user, the camera performs adaptive ROIadjustment, to keep the user in the center of a framing range.

When the user moves to the recommended training location, step 709 isperformed, to recognize a specified action according to an actionmatching algorithm.

In this embodiment of this application, an example is used in which themobile phone determines, by recognizing that the user completes thespecified action, that the user is ready to start training. Theinterface content shown in FIG. 8(a) may be displayed in the displayinterface, to prompt the user to complete the specified action. Themobile phone may obtain an image that the user completes the specifiedaction, recognize an action of the user according to the action matchingalgorithm, and determine accuracy of the action of the user. When asimilarity between the action of the user and the specified action meetsa requirement, it may be considered that the user has completed thespecified action, to continue to perform a next operation.

710. Lock the framing range of the camera, to keep the user in thecenter of the framing range.

To ensure that a picture range does not change in the movement processof the user, after determining that the user is ready to start training,the mobile phone locks the framing range of the camera, to keep the userin the center of the framing range. It should be understood that, inthis embodiment of this application, keeping the user in the center ofthe framing range of the camera may be understood as keeping the user inthe center of the viewfinder frame in the display interface.

711. Perform affine transformation on a skeleton point based on aplurality of frames of images.

The plurality of frames of images may be obtained in the process inwhich the user moves to the recommended training location. In a processof determining a location for the user to stand, that is, in a processfrom starting the camera application by the mobile phone to movement ofthe user to the training location recommended by the mobile phone, themobile phone may obtain a plurality of frames of images of the user,recognize the skeleton point of the user based on the plurality offrames of images, and perform an affine transformation on the recognizedskeleton point, to ensure that action matching is not affected by anangle, and ensure that a change of the angle of the user relative to apicture does not affect accuracy of training action evaluation.

In the following, the mobile phone may perform a play operation on thetarget course video, for example, play sound in the target course videoby using a speaker, to guide the user to start training.

Optionally, to obtain a larger field of view , a wide-angle camera or arotatable camera may be used as the camera. When the rotatable camera isused, step 701 may be replaced with step 702, to scan a current scenariohorizontally. In this step, the camera may rotate by using a rotatablemechanism to scan the current scenario. For example, when a width of atraining environment in which the user is located is insufficient toinclude a whole body of the user into a display range or there is alarge quantity of obstructions, a field of view may be obtained by usingthe rotatable mechanical structure, to expand a recommendation range forlocations to stand, and ensure that training is normally performed.

When the rotatable camera is used, in step 705, in the movement processof the user, the camera performs ROI adaptive adjustment, to keep theuser in the center of the framing range. When the user moves to an edgeof the viewfinder frame, the mechanical structure rotates, to continueto keep the user in the center of the framing range.

With reference to the foregoing embodiments and related accompanyingdrawings, the embodiments of this application provide a prompt method.The method may be implemented by the electronic device (for example, amobile phone or a tablet computer) having a camera in FIG. 1 and FIG. 2.FIG. 14 is a schematic flowchart of a prompt method according to anembodiment of this application. As shown in FIG. 14, the method mayinclude the following steps.

801. Obtain required training space, where the required training spaceis used to complete one or more training actions.

There are a plurality of manners of obtaining the required trainingspace.

In a possible implementation, the required training space may bedetermined based on an activity space of a coach in a target coursevideo and/or a body shape parameter of a user.

For example, the electronic device may determine the required trainingspace based on the activity space of the coach in the target coursevideo. Specifically, the electronic device obtains the target coursevideo, where the target course video includes at least one trainingaction; processes the target course video to obtain training spacerequired by each training action in the at least one training action;and determines, as the required training space, training spacecorresponding to a training action that requires a maximum trainingspace and that is in the at least one training action. In other words,after obtaining the target course video, the electronic device mayprocess the target course video, for example, analyze an activity trackof the coach in the target course video, to obtain the training spacerequired by each training action included in the target course video;and determine, as the required training space based on a comparisonresult, the training space corresponding to the training action thatrequires a maximum training space and that is in the target coursevideo. In this way, the determined required training space may be usedto complete all training actions in the target course video.

The required training space is determined based on the activity space ofthe coach in the target course video, and a suitable training locationis recommended to the user based on a training scenario and the requiredtraining space. The user does not need to select, based on spacerequired by a course, a location for performing training, and thetraining location is recommended to the user based on the activity spaceof the coach. The recommended training location is more accurate, and ismore suitable for the user to perform training corresponding to thetarget course video.

For another example, the mobile phone may determine the requiredtraining space based on the body shape parameter of the user.Optionally, the electronic device may obtain the body shape parameter ofthe user by scanning the user. The body shape parameter of the userincludes a body size, a weight, a volume, a surface area, and the like.The body size may include a height, an eye height, a shoulder height, anelbow height, a length of an upper arm, a length of a thigh, a length ofa crus, and the like. As an example instead of a limitation, theelectronic device may determine, as the required training space, a spaceoccupied when the user extends both arms; determine, as the requiredtraining space, a volume of a cylinder whose height is a height of theuser and whose diameter is a distance that is between fingertips of bothhands and that exists when the user extends both arms; or determine, asthe required training space, a volume of a cube whose edge length is aheight of the user. Specifically, the required training space may bedetermined according to different algorithms This is not limited in thisembodiment of this application.

When the required training space is determined based on the body shapeparameter of the user, a training location suitable for the user may berecommended to the user. The recommended training location is morepersonalized. This improves adaptation between the recommended traininglocation and the training action of the user.

For example, the mobile phone may determine the required training spacebased on the activity space of the coach in the target course video andthe body shape parameter of the user. The electronic device maydetermine a rough required training space based on the activity space ofthe coach in the target course video, and then adjust the rough requiredtraining space based on the body shape parameter of the user, to obtainthe required training space suitable for the user.

When the required training space is determined based on the activityspace of the coach in the target course video and the body shapeparameter of the user, both a requirement of space required by thetraining action and a body shape of the user can be considered, so thata training location suitable for the user can be recommended to theuser.

In a possible implementation, the required training space may bedetermined based on a training space parameter defined by the user. Forexample, the electronic device may display the interface shown in FIG.11(b). In the interface, the user may input a user-defined parameter,such as a diameter and a height, a length, a width, and a height, or anedge length.

In a possible implementation, the required training space may be preset.

802. Determine, based on a training scenario in which the user islocated and the required training space, a training location recommendedto the user.

The electronic device may obtain information about the trainingscenario. For example, the electronic device may first start a camera ofthe electronic device, then obtain an image that is of the trainingscenario and that is acquired by the camera, and process the acquiredimage of the training scenario to obtain the information about thetraining scenario.

The information about the training scenario may include information suchas depth information of the training scenario, length, width, and heightparameters, or a location, a shape, and a size of an object in thetraining scenario.

The electronic device may start the camera after detecting a signal thatthe user taps “start training”.

The camera in this embodiment of this application may be any one of anRGB camera, a depth camera, a wide-angle camera, or a camera with arotatable mechanical structure. When the camera is a depth camera, thedepth information of the training scenario by scanning the trainingscenario, so that the training location recommended to the user is moresuitable for the user to perform training. A larger field of view can beobtained by using the wide-angle camera or the camera with the rotatablemechanical structure, so that a range of the training locationrecommended to the user can be expanded, and a suitable traininglocation can be found more easily.

Optionally, the electronic device may display a processed image that isof the training scenario and that is acquired by the camera, forexample, the image displayed in the field of view shown in FIG. 5(b),FIG. 5(d), and FIG. 5(f).

Optionally, the determining, based on a training scenario in which theuser is located and the required training space, a training locationrecommended to the user includes: starting a camera of the electronicdevice, and scanning the training scenario; and in a scanning process,calculating a location that is in the training scenario and that meetsthe required training space, and determining the location as thetraining location recommended to the user.

Optionally, after determining the training location recommended to theuser, the electronic device may further guide the user to move to thetraining location recommended to the user. Specifically, the followingsteps may be performed: determining a current location of the user inthe training scenario; and outputting prompt information based on thecurrent location of the user in the training scenario and the traininglocation recommended to the user, to prompt the user to move to thetraining location recommended to the user.

It should be understood that the current location of the user in thetraining scenario may be a current coordinate of a location of the userin the training scenario. The coordinate of a location may be used toobtain a real-time image of the user, process the real-time image of theuser according to an image algorithm, recognize the current location ofthe user in the training scenario, and calculate a coordinate of thelocation of the user in the training scenario.

Specifically, the electronic device may determine, based on a distancedifference between the coordinate of a location of the user in thetraining scenario and a coordinate of the training location recommendedto the user (for example, a coordinate of the center point of thetraining location recommended to the user), whether the user reaches therecommended training location, or a direction and/or a distance in whichthe user needs to move, to output prompt information to prompt the userto move to the recommended training location.

The user is guided by using the prompt information, so that the user canquickly reach the recommended training location, and the user does notneed to determine the location. This improves user experience, andensures that the user can also normally perform training in a scenarioin which exercise space is limited.

Optionally, the prompt information includes at least one of a pictureprompt, a voice prompt, and a notification prompt, for example, a pop-upbox notification, a voice prompt, and a recommended region displayed onthe ground. For example, the electronic device may display, theinterface shown in FIG. 5(a) to FIG. 8(e).

803. Collect a training action of the user based on the traininglocation recommended to the user.

Optionally, before recording the training action of the user based onthe training location recommended to the user, the electronic device mayprompt the user to confirm to start training. Specifically, thefollowing steps may be performed: determining that the user moves to thetraining location recommended to the user; and outputting confirmationinformation, where the confirmation information is used to prompt theuser to start training.

Optionally, the confirmation information may include a manner such asaction recognition, gesture recognition, voice recognition, countdowntiming, and Bluetooth confirmation. When the user completes specifiedaction matching, specified gesture recognition, specified commandrecognition, or Bluetooth confirmation, or countdown timing ends, themobile phone determines that the user has started training. For example,the electronic device may display the interface shown in FIG. 8(a) toFIG. 8(e).

Optionally, after the user starts training, the electronic device mayevaluate the training action of the user. To ensure that action matchingis not affected by an angle, and ensure that a change of the angle ofthe user relative to a picture does not affect accuracy of a trainingaction evaluation, before the user starts training, the method furtherincludes: obtaining a plurality of frames of images of the user, whereeach frame of image in the plurality of frames of images includes atleast one recognized point; and performing an affine transformation onany two frames of images in the plurality of frames of images based onthe at least one recognized point.

In this embodiment of this application, a suitable training location isrecommended to the user based on the training scenario and the requiredtraining space. Therefore, the user can also normally perform trainingin a scenario in which exercise space is limited, for example, whenthere is an obstruction or the site is insufficient. Further, the usermay be guided to the recommended training location by using the promptinformation, so that the user can quickly reach the recommended traininglocation, and the user does not determine the training location. Thisimproves user experience.

It may be understood that, to implement the foregoing functions, theelectronic device includes corresponding hardware and/or softwaremodules for performing the functions. With reference to algorithm stepsof each example described in the embodiments disclosed in thisspecification, this application can be implemented in a form of hardwareor a combination of hardware and computer software. Whether a functionis performed by hardware or hardware driven by computer software dependson the particular applications and design constraints of the technicalsolutions. A person skilled in the art may use different methods toimplement the described functions for each particular application withreference to the embodiments, but it should not be considered that theimplementation goes beyond the scope of this application.

In the embodiments, the electronic device may be divided into functionmodules based on the foregoing method examples. For example, eachfunction module corresponding to each function may be obtained throughdivision, or two or more functions may be integrated into one processingmodule. The integrated module may be implemented in a form of hardware.It should be noted that division into modules in the embodiments is anexample, and is merely logical function division. In an actualimplementation, another division manner may be used.

When each function module is obtained through division by using eachcorresponding function, FIG. 15 is a schematic diagram of possiblecomposition of an electronic device 900 in the foregoing embodiments. Asshown in FIG. 15, the electronic device 900 may include an obtainingunit 901, a processing unit 902, and a collection unit 903.

The obtaining unit 901 may be configured to support the electronicdevice 900 in performing step 801 and/or another process used in thetechnology described in this specification, for example, step 704 andstep 705 in FIG. 13.

The processing unit 902 may be configured to support the electronicdevice 900 in performing step 802 and/or another process used in thetechnology described in this specification, for example, step 702, step703, and step 707 to step 711 in FIG. 13.

The collection unit 903 may be configured to support the electronicdevice 900 in performing step 803 and/or another process used in thetechnology described in this specification.

It should be noted that all related content of the steps in theforegoing method embodiments may be cited in function description ofcorresponding function modules. Details are not described herein again.

The electronic device provided in this embodiment is configured toperform the prompt method. Therefore, effects that are the same as thoseof the foregoing implementation method can be achieved.

When an integrated unit is used, the electronic device may include aprocessing module, a storage module, and a communications module. Theprocessing module may be configured to control and manage an action ofthe electronic device, for example, may be configured to support theelectronic device in performing the steps performed by the obtainingunit 901, the processing unit 902, and the collection unit 903. Thestorage module may be configured to support the electronic device tostore program code, data, and the like. The communications module may beconfigured to support communication between the electronic device andanother device.

The processing module may be a processor or a controller. The processingmodule may implement or execute various example logical blocks, modules,and circuits described with reference to content disclosed in thisapplication. Alternatively, the processor may be a combination ofprocessors implementing a computing function, for example, a combinationof one or more microprocessors, or a combination of a digital signalprocessor (DSP) and a microprocessor. The storage module may be amemory. The communications module may be specifically a device thatinteracts with another electronic device, such as a radio frequencycircuit, a Bluetooth chip, or a Wi-Fi chip.

In an embodiment, when the processing module is a processor and thestorage module is a memory, the electronic device in this embodiment maybe a device having the structure shown in FIG. 1.

An embodiment further provides a computer storage medium. The computerstorage medium stores computer instructions; and when the computerinstructions are run on an electronic device, the electronic device isenabled to perform the foregoing related method steps, to implement theprompt method in the foregoing embodiments.

An embodiment further provides a computer program product. When thecomputer program product runs on a computer, the computer is enabled toperform the foregoing related steps, to implement the prompt method inthe foregoing embodiments.

In addition, an embodiment of this application further provides anapparatus. The apparatus may be specifically a chip, a component, or amodule. The apparatus may include a processor and a memory that areconnected to each other. The memory is configured to storecomputer-executable instructions. When the apparatus runs, the processormay execute the computer-executable instructions stored in the memory,to enable the chip to perform the prompt method in the foregoing methodembodiments.

The electronic device, the computer storage medium, the computer programproduct, or the chip provided in the embodiments is configured toperform a corresponding method provided above. Therefore, for beneficialeffects that can be achieved by the electronic device, the computerstorage medium, the computer program product, or the chip, refer tobeneficial effects of the corresponding method provided above. Detailsare not described herein again.

The foregoing descriptions about implementations allow a person skilledin the art to understand that, for convenient and brief description,division into the foregoing function modules is taken as an example forillustration. In actual application, the foregoing functions can beallocated to different function modules for implementation according toa requirement, in other words, an inner structure of an apparatus isdivided into different function modules to implement all or some of thefunctions described above.

In the several embodiments provided in this application, it should beunderstood that the disclosed apparatus and method may be implemented inanother manner. For example, the described apparatus embodiment ismerely an example. For example, division into the modules or units ismerely logical function division and may be other division in actualimplementation. For example, a plurality of units or components may becombined or integrated into another apparatus, or some features may beignored or not performed. In addition, the displayed or discussed mutualcoupling or direct coupling or communication connections may beimplemented by using some interfaces. The indirect coupling orcommunication connections between the apparatuses or units may beimplemented in electronic, mechanical, or other forms.

The units described as separate parts may or may not be physicallyseparate, and parts displayed as units may be one or more physicalunits, may be located in one place, or may be distributed on differentplaces. Some or all of the units may be selected based on actualrequirements to achieve the objectives of the solutions of theembodiments.

In addition, function units in the embodiments of this application maybe integrated into one processing unit, or each of the units may existalone physically, or two or more units may be integrated into one unit.The integrated unit may be implemented in a form of hardware, or may beimplemented in a form of a software function unit.

When the integrated unit is implemented in a form of a software functionunit and sold or used as an independent product, the integrated unit maybe stored in a readable storage medium. Based on such an understanding,the technical solutions of the embodiments of this applicationessentially, or the part contributing to the current technology, or allor some of the technical solutions may be implemented in a form of asoftware product. The software product is stored in a storage medium andincludes several instructions for instructing a device (which may be asingle-chip microcomputer, a chip, or the like) or a processor toperform all or some of the steps of the methods described in theembodiments of this application. The foregoing storage medium includesany medium that can store program code, such as a USB flash drive, aremovable hard disk, a read-only memory (ROM), a random access memory(RAM), a magnetic disk, or an optical disc.

The foregoing content is merely specific implementations of thisapplication, but is not intended to limit the protection scope of thisapplication. Any variation or replacement readily figured out by aperson skilled in the art within the technical scope disclosed in thisapplication shall fall within the protection scope of this application.Therefore, the protection scope of this application shall be subject tothe protection scope of the claims.

1. A method for fitness training, applied to an electronic device, andcomprising: obtaining a required training space, wherein the requiredtraining space is used to complete one or more training actions;determining, based on a training scenario in which a user is located andthe required training space, a training location to recommend to theuser; and recording a training action of the user based on the traininglocation recommended to the user.
 2. The method according to claim 1,wherein obtaining the required training space comprises: determining therequired training space based on an activity space of a coach in atarget course video; determining the required training space based on abody shape parameter of the user; determining the required trainingspace based on the activity space of the coach in the target coursevideo and the body shape parameter of the user; or determining therequired training space based on a training space parameter defined bythe user.
 3. The method according to claim 1, wherein the determining,based on the training scenario in which a user is located and therequired training space, the training location recommended to the usercomprises: starting a camera of the electronic device, and scanning thetraining scenario; and in a scanning process, calculating a locationthat is in the training scenario and that meets the required trainingspace, wherein the location is the training location recommended to theuser.
 4. The method according to claim 3, wherein the camera is any oneof an RGB camera, a depth camera, a wide-angle camera, or a cameramounted to a rotatable mechanical structure.
 5. The method according toclaim 1, further comprising: determining a current location of the userin the training scenario; and outputting prompt information based on thecurrent location of the user in the training scenario and the traininglocation recommended to the user, to prompt the user to move to thetraining location recommended to the user.
 6. The method according toclaim 5, wherein the prompt information comprises at least one of apicture prompt, a voice prompt, and a notification prompt.
 7. The methodaccording to claim 1, before recording the training action of the userbased on the training location recommended to the user, the methodfurther comprises: determining that the user has moved to the traininglocation recommended to the user; and outputting confirmationinformation, wherein the confirmation information is used to prompt theuser to start training.
 8. The method according to claim 1, furthercomprising: obtaining a plurality of frames of images of the user,wherein each frame in the plurality of frames of images comprises atleast one recognized point; and performing an affine transformation onany two frames in the plurality of frames of images based on the atleast one recognized point.
 9. An electronic device, comprising: one ormore processors; one or more memories; a plurality of applications; andone or more programs, wherein the one or more programs are stored in thememory, and when the one or more programs are executed by the processor,the electronic device is enabled to perform the following steps:obtaining a required training space, wherein the required training spaceis used to complete one or more training actions; determining, based ona training scenario in which a user is located and the required trainingspace, a training location recommended to the user; and recording atraining action of the user based on the training location recommendedto the user.
 10. The electronic device according to claim 9, whereinwhen the one or more programs are executed by the processor, theelectronic device is enabled to perform the further following steps:determining the required training space based on an activity space of acoach in a target course video; determining the required training spacebased on a body shape parameter of the user; determining the requiredtraining space based on the activity space of the coach in the targetcourse video and the body shape parameter of the user; or determiningthe required training space based on a training space parameter definedby the user.
 11. The electronic device according to claim 9, whereinwhen the one or more programs are executed by the processor, theelectronic device is enabled to perform the further following steps:starting a camera of the electronic device, and scanning the trainingscenario; and in a scanning process, calculating a location that is inthe training scenario and that meets the required training space,wherein the location is the training location recommended to the user.12. The electronic device according to claim 11, wherein the camera isany one of an RGB camera, a depth camera, a wide-angle camera, or acamera mounted to a rotatable mechanical structure.
 13. The electronicdevice according to claim 9, wherein when the one or more programs areexecuted by the processor, the electronic device is enabled to performthe further following steps: determining a current location of the userin the training scenario; and outputting prompt information based on thecurrent location of the user in the training scenario and the traininglocation recommended to the user, to prompt the user to move to thetraining location recommended to the user.
 14. The electronic deviceaccording to claim 13, wherein the prompt information comprises at leastone of a picture prompt, a voice prompt, and a notification prompt. 15.The electronic device according to claim 9, wherein when the one or moreprograms are executed by the processor, the electronic device is enabledto perform the further following steps: determining that the user hasmoved to the training location recommended to the user; and outputtingconfirmation information, wherein the confirmation information is usedto prompt the user to start training.
 16. The electronic deviceaccording to claim 9, wherein when the one or more programs are executedby the processor, the electronic device is enabled to perform thefurther following steps: obtaining a plurality of frames of images ofthe user, wherein each frame in the plurality of frames of imagescomprises at least one recognized point; and performing an affinetransformation on any two frames in the plurality of frames of imagesbased on the at least one recognized point.
 17. A non-transitorycomputer storage medium, comprising computer instructions, wherein whenthe computer instructions are run on an electronic device, theelectronic device is enabled to perform the prompt method according toclaim
 1. 18. (canceled)